Пример #1
0
        public void FirmwareGetPassword(TestData.Fw fw_paths)
        {
            foreach (TestData.Fw fw in fw_paths.GetFlags())
            {
                var ret = FwTools.GetPassword(TestData.GetFwPath(fw));

                Assert.NotNull(ret);
            }
        }
Пример #2
0
 public async void GetPasswordDialog()
 {
     if (this.FwPath != "" && File.Exists(this.FwPath))
     {
         try
         {
             var password = FwTools.GetPassword(this.FwPath);
             if (password == null)
             {
                 MessageBox.Show(ERR4, "BSL430.NET", MessageBoxButton.OK, MessageBoxImage.Error);
             }
             else
             {
                 if (this.PasswordMCU == MCU.MSP430_F1xx ||
                     this.PasswordMCU == MCU.MSP430_F2xx ||
                     this.PasswordMCU == MCU.MSP430_F4xx ||
                     this.PasswordMCU == MCU.MSP430_G2xx3)
                 {
                     this.PasswordHeader = "20-byte old 1xx/2xx/4xx BSL password";
                     this.PasswordData   = BitConverter.ToString(password.Password20Byte).Replace("-", "");
                 }
                 else if (this.PasswordMCU == MCU.MSP430_F543x_NON_A)
                 {
                     this.PasswordHeader = "16-byte special F543x (non A) BSL password";
                     this.PasswordData   = BitConverter.ToString(password.Password16Byte).Replace("-", "");
                 }
                 else
                 {
                     this.PasswordHeader = "32-byte standard 5xx/6xx BSL password";
                     this.PasswordData   = BitConverter.ToString(password.Password32Byte).Replace("-", "");
                 }
                 this.IsDialogOpen = true;
                 await coordinator.ShowMetroDialogAsync(this, dialogGetPassword, dialogSettings);
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.GetExceptionMsg(), "BSL430.NET", MessageBoxButton.OK, MessageBoxImage.Error);
         }
     }
     else
     {
         MessageBox.Show(ERR1, "BSL430.NET", MessageBoxButton.OK, MessageBoxImage.Warning);
     }
     this.IsDialogOpen = false;
 }