public bool QPHONEMS_SaharaOpenPortWithChipValidation(int Index, int Port, SelectOption EnableValidation, ulong MsmIdReferenceVal, out ulong MSM_ID, out ulong Version, SaharaDownloadMode mode, ulong timeout) { //ulong version = 0x00; ; Version = 0x00; MSM_ID = 0x00; string pkhash = ""; SetText(TextMessage[Index], Index, "QPHONEMS_SaharaOpenPortWithChipValidation \r\n"); try { //phone[Index].SetLibraryMode(LibraryModeEnum.QPhoneMS); SetText(TextMessage[Index], Index, "Connecting to phone " + Port.ToString()); phone[Index].ConnectToServer_Sahara((uint)Port, ref Version, ref MsmIdReferenceVal, ref MSM_ID, ref pkhash, (int)mode, timeout); SetText(TextMessage[Index], Index, "Sahara protocol version supported by the device = " + Version); SetText(TextMessage[Index], Index, "MSM ID = " + MSM_ID); if (EnableValidation == SelectOption.Yes && MsmIdReferenceVal != MSM_ID) { SetText(TextMessage[Index], Index, "Reference ID " + MsmIdReferenceVal + " is not matched with MSM_ID " + MSM_ID); return false; } return true; } catch (Exception ex) { SetText(TextMessage[Index], Index, ex.Message); return false; } }
public bool QPHONEMS_SaharaOpenPort(int Index, out ulong Version, int Port, SaharaDownloadMode mode, ulong timeout) { //ulong version = 0x00; ; Version = 0x00; SetText(TextMessage[Index], Index, "------------QPHONEMS_SaharaOpenPort--------------\r\n"); try { phone[Index].SetLibraryMode(LibraryModeEnum.QPhoneMS); SetText(TextMessage[Index], Index, "Connecting to phone " + Port.ToString()); phone[Index].ConnectToServer_Sahara((uint)Port, ref Version, (int)mode, timeout); SetText(TextMessage[Index], Index, "Sahara protocol version supported by the device = " + Version + "\r\n"); return true; } catch (Exception ex) { SetText(TextMessage[Index], Index, ex.Message); return false; } }