diff options
author | Ben Chan <benchan@chromium.org> | 2013-09-26 11:07:16 -0700 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2013-09-26 20:23:51 +0200 |
commit | b5ef861d12c7533d89a18454b03e8e3301164bea (patch) | |
tree | d49cbf5d285f623de42879a271c0b388dba4a8b1 /plugins | |
parent | b786ac0debc7aa5e9a6b0f00bd61e15d9daea049 (diff) |
modem-helpers,sim: auto-detect if ICCID response is character swapped
This patch modifies mm_3gpp_parse_iccid() to auto-detect if an ICCID
response is character swapped or not by comparsing the major industry
identifier part of the ICCID response to the known value (89) for
telecommunication purposes. This addresses the issue where the same AT
command (e.g. AT^ICCID used by the huawei plugin) does not report ICCID
in a consistent format.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/huawei/mm-sim-huawei.c | 3 | ||||
-rw-r--r-- | plugins/sierra/mm-sim-sierra.c | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/plugins/huawei/mm-sim-huawei.c b/plugins/huawei/mm-sim-huawei.c index 7963180d..7bf4106c 100644 --- a/plugins/huawei/mm-sim-huawei.c +++ b/plugins/huawei/mm-sim-huawei.c @@ -87,8 +87,7 @@ iccid_read_ready (MMBaseModem *modem, if (!p) goto error; - /* Huawei ^ICCID response must be character swapped */ - parsed = mm_3gpp_parse_iccid (p, TRUE, NULL); + parsed = mm_3gpp_parse_iccid (p, NULL); if (parsed) { g_simple_async_result_set_op_res_gpointer (simple, parsed, g_free); g_simple_async_result_complete (simple); diff --git a/plugins/sierra/mm-sim-sierra.c b/plugins/sierra/mm-sim-sierra.c index 05c88eb4..d8a4715f 100644 --- a/plugins/sierra/mm-sim-sierra.c +++ b/plugins/sierra/mm-sim-sierra.c @@ -82,8 +82,7 @@ iccid_read_ready (MMBaseModem *modem, return; } - /* Sierra !ICCID response is already character swapped */ - parsed = mm_3gpp_parse_iccid (p, FALSE, &local); + parsed = mm_3gpp_parse_iccid (p, &local); if (parsed) g_simple_async_result_set_op_res_gpointer (simple, parsed, g_free); else |