public bool UIM_Simlock_CKLOCK_NW(SIMLOCK_SLOT slot, SIMLOCK_CATEGORY category, SIMLOCK_AUTOLOCK autolock, SIMLOCK_BLACKLIST blacklist, uint num_retries_max, uint iteration_cnt, int ck_len, string ck_data, string mcc, string mnc_length, string mnc, string mcc_mnc_csv_file, bool useCsvFile, int num_codes, out uint command_status) { string mcc_mnc = ""; byte[] b_array; string hex_ckdata = ""; byte[] byte_array = null; command_status = 0; mnc_length = ConvertToBinaryString(mnc_length); hex_ckdata = ConvertToHexString(ck_data); b_array = Construct_ByteArray_From_String(hex_ckdata); this.UDebugWindow("----------------------UIM_Simlock_CKLOCK_Network-------------------"); try { if (useCsvFile == false) { mcc = ConvertToHexString(mcc); mnc = ConvertToHexString(mnc); mcc_mnc = mcc + mnc_length + mnc; } else { List<string> mcc_mnc_pairs = null; UIM_Simlock_Get_MCC_MNC_Pairs_From_CSV(mcc_mnc_csv_file, ref mcc_mnc_pairs); foreach (string pair in mcc_mnc_pairs) { string temp = pair; temp = Adjust_DATA_TO_CODEDATA_Format(temp); mcc_mnc += temp; } } this.UDebugWindow(string.Format("Programming MCC + MNC: {0}", mcc_mnc)); byte_array = Intialize_Byte_Array(num_codes, byte_array); byte_array = Construct_ByteArray_From_String(mcc_mnc); phone.SIMLOCK_CK_LOCK_CMD((byte)slot, (byte)category, (byte)autolock, (byte)blacklist, num_retries_max, iteration_cnt, (byte)ck_len, b_array, (byte)num_codes, byte_array, ref command_status); return true; } catch (Exception ex) { this.UDebugWindow(ex.Message); return false; } }
public bool UIM_Simlock_Unlock(SIMLOCK_SLOT slot, SIMLOCK_CATEGORY category, int ck_len, string ck_data, out uint command_status) { byte[] b_array = new byte[ck_len]; string hex_ckdata = ""; command_status = 0; hex_ckdata = ConvertToHexString(ck_data); b_array = Construct_ByteArray_From_String(hex_ckdata); //UpdateDebugWindow("----------------------UIM_Simlock_Unlock-------------------"); try { phone.SIMLOCK_UNLOCK_CMD((byte)slot, (byte)category, (byte)ck_len, b_array, ref command_status); return true; } catch (Exception ex) { // UpdateDebugWindow(ex.Message); return false; } }