diff options
author | Denis Kenzior <denkenz@gmail.com> | 2009-10-02 14:52:52 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2009-10-02 18:25:56 -0500 |
commit | c9a2eedc08b5a7ba625dac3764f176676c11d304 (patch) | |
tree | e7ba2479fc2e0609850510cc52c5486e36c2a5d9 /drivers | |
parent | 53496c6a32d36cc694dbb9162048a78de10c4646 (diff) | |
download | ofono-c9a2eedc08b5a7ba625dac3764f176676c11d304.tar.bz2 |
Add utility to parse 2G GET_RESPONSE data
This format is described in 51.011 and the older 11.11. It is not
supported by newer 3G UICC based devices & sim card combinations
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/atmodem/sim.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/atmodem/sim.c b/drivers/atmodem/sim.c index d04b736c..7b8cede3 100644 --- a/drivers/atmodem/sim.c +++ b/drivers/atmodem/sim.c @@ -50,7 +50,7 @@ static void at_crsm_info_cb(gboolean ok, GAtResult *result, gpointer user_data) const guint8 *response; gint sw1, sw2, len; int flen, rlen; - enum ofono_sim_file_structure str; + int str; unsigned char access[3]; dump_response("at_crsm_info_cb", ok, result); @@ -82,17 +82,7 @@ static void at_crsm_info_cb(gboolean ok, GAtResult *result, gpointer user_data) ofono_debug("crsm_info_cb: %02x, %02x, %i", sw1, sw2, len); - flen = (response[2] << 8) | response[3]; - str = response[13]; - - access[0] = response[8]; - access[1] = response[9]; - access[2] = response[10]; - - if (str == 0x01 || str == 0x03) - rlen = response[14]; - else - rlen = 0; + sim_parse_2G_get_response(response, len, &flen, &rlen, &str, access); cb(&error, flen, str, rlen, access, cbd->data); } |