mm-shared-qmi: parse ICCID as hex instead of BCD

Fixes issue 364.
This commit is contained in:
Eric Caruso
2021-05-04 13:38:57 -07:00
committed by Aleksander Morgado
parent 27c43075f9
commit ba0701b67d

View File

@@ -3308,8 +3308,10 @@ uim_get_slot_status_ready (QmiClientUim *client,
continue; continue;
} }
raw_iccid = mm_bcd_to_string ((const guint8 *)slot_status->iccid->data, slot_status->iccid->len, /* This is supposed to be BCD, but some carriers have non-spec-compliant ICCIDs that use
TRUE /* low_nybble_first */); * A-F characters as part of the operator-specific part of the ICCID. Parse it as hex and
* let mm_3gpp_parse_iccid take care of handling the A-F characters properly. */
raw_iccid = mm_utils_bin2hexstr ((const guint8 *)slot_status->iccid->data, slot_status->iccid->len);
if (!raw_iccid) { if (!raw_iccid) {
mm_obj_warn (self, "not creating SIM object: failed to convert ICCID from BCD"); mm_obj_warn (self, "not creating SIM object: failed to convert ICCID from BCD");
g_ptr_array_add (ctx->sim_slots, NULL); g_ptr_array_add (ctx->sim_slots, NULL);