コード例 #1
0
 private void ResetPCM_Click(object sender, RoutedEventArgs e)
 {
     if (this.searchforframe != "PCM_READY")
     {
         this.consolemessage("PCM busy/not in flash mode");
         return;
     }
     if (MessageBox.Show("Exit flash mode and reset, are you sure?", "Confirm", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes) != MessageBoxResult.Yes)
     {
         this.consolemessage("Reset cancelled");
         return;
     }
     this.rxserialbuffer = null;
     this.WriteSerialData(OBD.ResetPCM(), false);
     Thread.Sleep(100);
     this.WriteSerialData(OBD.AVTNormalSpeed(), true);
     this.Serialout.Clear();
     this.searchforframe = "VERIFY_EXIT";
 }