Commit Graph
2478 Commits
Author SHA1 Message Date
Michael Farrell 6e7ff47109 proxmark3 is not a modem, blacklist it.
ModemManager locks the proxmark3 when it is connected. As it is not a modem,
ModemManager shouldn't be talking to it.

At present, the recommended action in the proxmark3 documentation is to
purge ModemManager to fix this issue.

Note that this vendor uses an unregistered USB device ID, so it is
instead matched by the manufacturer string.

References:
- http://store.ryscc.com/blogs/news/45802433
- http://www.proxmark.org/forum/viewtopic.php?id=1759
2016-02-20 16:30:01 +01:00
Aleksander Morgado cffba7e0ee modem-helpers: regex creation should never fail
We should really consider errors if we expect that the regex string may not
compile; but in this case the pattern is fixed, so should never happen.
2016-02-13 14:33:12 +01:00
Thomas Sailer 95876c6f57 helpers: move +CRSM parsing to mm_3gpp_parse_crsm_response
Also added test cases.

Signed-off-by: Thomas Sailer <t.sailer@alumni.ethz.ch>
2016-02-13 14:27:51 +01:00
Thomas Sailer a33615d6cb helpers: allow optional quotes in +CREG: <stat>,"<lac>","<ci>"
GSM 07.07 CREG=2 unsolicited pattern.

Added testcase for Thuraya XT.

Signed-off-by: Thomas Sailer <t.sailer@alumni.ethz.ch>
2016-02-13 14:24:54 +01:00
Dan Williams 9cb0b22f91 broadband-modem-qmi: fix compile errors with newest QMI commands enabled 2016-02-11 11:09:54 -06:00
Dan Williams 232d4d4aae broadband-bearer: don't send disconnect CGACT on data port for multi-port modems
A Huawei E173 (with FW 11.126.15.00.445) seems to stop responding on the
primary port (ttyUSB2) when the CGACT is resent on the data port (ttyUSB0).
The CGACT-on-data-port was originally added as a fallback attempt to get
single-port modems to disconnect when all other methods failed.

For single-port modems, the primary port is also the data port so this
patch will have no effect.

For multi-port modems, this patch will retry the CGACT on the primary
port which has a higher chance of success because we already know
the primary port is talking to us, while the data port may still
be stuck in PPP mode.
2016-02-11 10:46:17 -06:00
Thomas Sailer 4442173dcf modem-helpers: allow optional whitespace in +CGDCONT response
Add testcase for Thuraya XT.

Signed-off-by: Thomas Sailer <t.sailer@alumni.ethz.ch>
2016-02-11 15:34:25 +01:00
Aleksander Morgado 18c8dd60a7 qmi: just one InvalidCommand error is enough to avoid all DMS UIM commands
The MMBroadbandModemQmi will not create a MMSimQmi until the unlock status has
been checked, and therefore this means that when the SIM object is being created
we already know whether the modem supports DMS UIM commands or not, so avoid
further fallbacks in the SIM object.
2016-02-11 10:52:09 +01:00
Aleksander Morgado 9cbd0c61b0 sim-qmi: implement SIM verify/unblock/change/enable with UIM service
Newer modems like the MC7455 don't implement the "DMS UIM" commands in the
DMS service, and therefore these modems need to use the UIM service directly.

We include a new flag to detect whether any of the DMS UIM commands is flagged
as invalid, and if so, we'll fallback to the UIM specific implementations for
all.

libqmi version bump to 1.13.7, which includes the new required methods.
2016-02-11 10:51:53 +01:00
Aleksander Morgado 7ded4f3c3b broadband-modem-qmi: implement unlock retries loading with UIM service
Newer modems like the MC7455 don't implement the "DMS UIM" commands in the
DMS service, and therefore these modems need to use the UIM service directly.
2016-02-11 10:51:43 +01:00
Tomas Jura 6a675536d6 serial: remove duplicated ECHO & ECHOE 2016-02-11 10:32:22 +01:00
Aleksander Morgado aeb6362172 sim-qmi: port to GTask 2016-01-30 18:38:05 -08:00
Aleksander Morgado b23dace6dd broadband-modem-qmi: plug memleak when listing SMS messages 2016-01-30 16:29:29 -08:00
Aleksander Morgado 8c905383b7 broadband-modem-qmi: locked states also indicate readiness of the SIM card
When the card application is flagged as needing PIN or PUK, then the card can be
considered as being ready.
2016-01-30 16:29:29 -08:00
Aleksander Morgado 83868c61b1 broadband-modem-qmi: use "UIM Get Card Status" if "DMS UIM" command unavailable
The newer modules like the MC7455 which support multiple SIM cards won't
implement the legacy "DMS UIM" commands.
2016-01-24 17:23:46 +01:00
Aleksander Morgado cf66d1bcbf bearer-qmi: use static IP if LLP is raw-ip
When using raw-ip we'll default to request static IP setup for now, so that we
don't rely on the DHCP client supporting raw-ip interfaces.
2016-01-24 17:23:46 +01:00
Aleksander Morgado f8ba106a20 port-qmi: support new Qualcomm chipsets working always in raw-ip
The port opening logic is changed completely.

Before this change, the logic would only try 802.3 setting via CTL when the
QmiDevice was being open.

With this new change, instead, we'll use WDA and the new libqmi APIs to query
the link layer protocol expected by both the device and the kernel. If the LLP
matches in both, we assume we're done; if they differ we'll try to update the
LLP expected by the kernel to the one setup in WDA. This change will allow us
to run with the modem using raw-ip if that is what WDA reports by default.

Also bumped the libqmi version to 1.13.6, which has support for the new required
APIs.
2016-01-24 17:23:18 +01:00
Aleksander Morgado 97962bb65c port-serial: rework response parsing
Response parsing was being done in different places for AT and QCDM subclasses;
in the case of AT it was being done early, before returning the byte array in
the mm_serial_port_command_finish() response. In the case of QCDM, it was being
done after mm_serial_port_command_finish(), and that was forcing every caller to
cleanup the response buffer once the response was processed.

With the new logic in this patch, the response is always parsed (i.e. looked for
a valid response or an error detected) before mm_serial_port_command_finish()
returns, and actually this method now returns a totally different GByteArray,
not the internal response buffer GByteArray, so there's no longer any need for
the caller to explicitly clean it up. The one doing the cleanup is the parser
method itself in every case.

This change also allows us to return serial port responses in idle, but that's
not changed for now as there's no immediate need.
2016-01-23 11:19:19 +01:00
Aleksander Morgado ede17bd41c port-serial: remove response buffer when an error is returned
When valid responses were returned to the caller of the serial command, the
caller itself was responsible for removing from the GByteArray the data that
it was successfully processed (all the data in AT, just 1 message in QCDM). But,
the same logic was missing for the case of errors; we were not explicitly
removing the response and therefore in some cases we would see it propagated
into the next command response. It was common to see this issue when the echo
removal was disabled in the serial port, as in Option/HSO modems:

    <debug> (ttyHS3): --> 'AT+CNUM<CR>'
    <debug> (ttyHS3): <-- '<CR><LF>+CME ERROR: 14<CR><LF>'
    <debug> Got failure code 14: SIM busy
    <debug> (ttyHS3) device open count is 1 (close)
    <warn>  couldn't load list of Own Numbers: 'Failed to parse NV MDN command result: -17'
    <debug> (ttyHS3) device open count is 2 (open)
    <debug> (ttyHS3): --> 'AT_OPSYS?<CR>'
    <debug> (ttyHS3): <-- '<CR><LF>_OPSYS: 1,2<CR><LF><CR><LF>OK<CR><LF>'
    <warn>  couldn't load current allowed/preferred modes: 'Couldn't parse OPSYS response: '+CME ERROR: 14
    _OPSYS: 1,2''
2016-01-23 11:05:42 +01:00
Dan Williams 98c58ca64b bearer-qmi: print IP details at 'info' log level 2016-01-19 17:19:22 -06:00
Aleksander Morgado 3b97d7e3d7 broadband-modem: plug memleaks when processing QCDM responses 2016-01-17 15:34:17 +01:00
Aleksander Morgado 884d7bee1b broadband-modem,time: make sure that error is set when operation fails 2016-01-16 17:59:49 +01:00
Aleksander Morgado 6a60090d68 broadband-modem,voice: fix regex leak 2016-01-12 16:37:28 +01:00
Aleksander Morgado 0ebf6d5da5 mbm: query supported modes to the modem with +CFUN=?
We were trying to load the generic modes supported reported by either *CNTI=2 or
AT+WS46=?, so that then we could filter out the MBM-specific modes unsupported.

But, this may not be ideal, as both these two commands may fail:

    [mm-broadband-modem.c:1612] modem_load_supported_modes(): loading supported modes...
    [mm-port-serial.c:1237] mm_port_serial_open(): (ttyACM1) device open count is 3 (open)
    [mm-port-serial.c:1294] _close_internal(): (ttyACM1) device open count is 2 (close)
    [mm-port-serial-at.c:440] debug_log(): (ttyACM1): --> 'AT*CNTI=2<CR>'
    [mm-port-serial-at.c:440] debug_log(): (ttyACM1): <-- '<CR><LF>ERROR<CR><LF>'
    [mm-serial-parsers.c:364] mm_serial_parser_v1_parse(): Got failure code 100: Unknown error
    [mm-broadband-modem.c:1546] supported_modes_cnti_ready(): Generic query of supported 3GPP networks with *CNTI failed: 'Unknown error'
    [mm-port-serial.c:1237] mm_port_serial_open(): (ttyACM1) device open count is 3 (open)
    [mm-port-serial.c:1294] _close_internal(): (ttyACM1) device open count is 2 (close)
    [mm-port-serial-at.c:440] debug_log(): (ttyACM1): --> 'AT+WS46=?<CR>'
    [mm-port-serial-at.c:440] debug_log(): (ttyACM1): <-- '<CR><LF>ERROR<CR><LF>'
    [mm-serial-parsers.c:364] mm_serial_parser_v1_parse(): Got failure code 100: Unknown error
    [mm-broadband-modem.c:1494] supported_modes_ws46_test_ready(): Generic query of supported 3GPP networks with WS46=? failed: 'Unknown error'
    [mm-iface-modem.c:3974] load_supported_modes_ready(): couldn't load Supported Modes: 'Couldn't retrieve supported modes'

Instead, we'll ask the modem for the list of modes supported, and return that
directly.
2016-01-10 17:46:12 +01:00
Aleksander Morgado 6c35878f12 location: support updating the GPS refresh time
The default setup uses a refresh time of 30s, which means that even if the GPS
location updates are received at a higher frequency, the DBus interface will
still expose at most one update every 30s.

This patch includes a new "SetGpsRefreshTime()" method in the Location
interface, which takes a single 'u' parameter, specifying the refresh rate to
use, in seconds. This method also allows 0 being passed, which will make the
implementation to publish the GPS location updates are soon as ModemManager
detects them.

Along with the new method, a "GpsRefreshTime" read-only property is exposed
to specify the refresh time in effect.

The new method and property will only be applicable if the device has GPS
capabilities.

https://bugs.freedesktop.org/show_bug.cgi?id=89924
2015-12-19 12:22:30 +01:00
Aleksander Morgado ae04c4179f bearer-mbim: implement stats loading 2015-12-07 14:20:54 +01:00
Aleksander Morgado cb59c6d93e bearer-qmi: implement stats loading
Use the "WDS Get Packet Statistics" method to query for the ongoing number
of bytes transmitted or received. The QMI implementation uses different WDS
clients for IPv4 and IPv6; the stats reported are a combination of the values
retrieved from both WDS clients.
2015-12-07 14:20:54 +01:00
Aleksander Morgado 3bf118d01a base-bearer: setup periodic stats loading
If the bearer implementation supports it, load stats periodically. By default
every 30s for now.
2015-12-07 14:20:54 +01:00
Aleksander Morgado 4c036eb8f9 iface-modem: explicitly disconnect bearer before removing it
https://bugs.freedesktop.org/show_bug.cgi?id=90408
2015-12-03 12:01:14 +01:00
Aleksander Morgado ea3cb005b8 bearer-list: rename bearer find method to specify properties are compared 2015-12-03 12:00:22 +01:00
Aleksander Morgado 75c2347990 bearer-list: no need for the method to remove all bearers 2015-12-03 11:43:21 +01:00
Aleksander Morgado 508a37a891 modem-helpers: fix parsing CPMS=? responses without groups
The CPMS test parser was expecting 3 groups (parenthesis enclosed lists) of
memory IDs, e.g.:

   +CPMS: ("SM","ME"),("SM","ME"),("SM","ME")

But some modems like the Huawei MU609 may just report single elements, not
groups, e.g.:

   +CPMS: "SM","SM","SM"

This patch avoids using g_strsplit() to split the groups, as that is unaware
of the possible replies without groups. Instead, a new helper method is
implemented which does the group/item split itself, considering also the
possibility of a reply with mixed groups and non-groups, like e.g.:

   +CPMS: ("SM","ME"),"SM","SM"

Additionally, we also now support the case where the groups are empty, e.g.:

   +CPMS: (),(),()

https://bugs.freedesktop.org/show_bug.cgi?id=92243
2015-12-02 22:34:37 +01:00
Aleksander Morgado ffde429843 core: use G_SOURCE_REMOVE and G_SOURCE_CONTINUE in GSourceFuncs 2015-12-02 17:07:39 +01:00
Felix Janda 2a99bdfa00 Do not use obsolete XCASE terminal mode flag
The XCASE terminal mode flag because is no longer specified by POSIX
and has no effect on linux. Because of the latter fact we can remove
it. This fixes a compilation error with musl libc.
2015-11-27 15:11:40 +01:00
Dan Williams 3129516736 broadband-modem-qmi: implement power-cycle reset functionality 2015-11-11 12:38:49 -06:00
Yunlian Jiang 4e00558fcb broadband-modem: fix a undifined behavior
. A shift has undefined behaviour if the mathematical result
(lhs * 2^{rhs}) doesn't fit in the range of the resulting type.
In other words, you can't left shift into the sign bit of a
signed integer type.
The error message is:

mm-broadband-modem.c:3308:15: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
SUMMARY: AddressSanitizer: undefined-behavior mm-broadband-modem.c:3308:15 in
2015-10-28 22:31:59 +01:00
Aleksander Morgado 35ab3dedd6 sim-qmi: try to gather from the optional TLV whether MNC is 2 or 3 digits
We bump libqmi requiremetn to 1.13.5, which is the one with support for the new TLV.
2015-10-25 15:48:42 +01:00
Aleksander Morgado 77b6b02fd3 sim-qmi: fix building MCCMNC string
For now, use 2 digits for MNC if < 100 and 3 digits otherwise.
2015-10-25 15:15:33 +01:00
Dan Williams 3f3ad507e2 sim-qmi: load operator identifier and name from NAS home network 2015-10-25 15:11:37 +01:00
Aleksander Morgado a89dadcbc6 bearer-qmi: don't add auth settings if no user/pass/auth given
Auth settings will be added in a QMI message only if at least one of these is
requested:
 * An explicit auth preference is requested.
 * User string is given and isn't empty.
 * Password string is given and isn't empty.
2015-10-21 17:24:24 +02:00
Aleksander Morgado 5b568e97f8 iface-modem-3gpp: allow LAC/CID updates reported while registering
When changing from idle to registered we'll load registration info before really
reporting that we're registered (so that clients can get the new registration
info directly). During this time, we should also allow LAC/CID updates triggered
in the location interface.

E.g. when receiving this QMI message, we're not processing LAC/CID because when
they get reported, the registration state was not yet 'registered':

    [/dev/cdc-wdm0] Received message (translated)...
    >>>>>> QMUX:
    >>>>>>   length  = 67
    >>>>>>   flags   = 0x80
    >>>>>>   service = "nas"
    >>>>>>   client  = 1
    >>>>>> QMI:
    >>>>>>   flags       = "indication"
    >>>>>>   transaction = 0
    >>>>>>   tlv_length  = 55
    >>>>>>   message     = "Serving System" (0x0024)
    >>>>>> TLV:
    >>>>>>   type       = "MNC PCS Digit Include Status" (0x29)
    >>>>>>   length     = 5
    >>>>>>   value      = D6:00:01:00:00
    >>>>>>   translated = [ mcc = '214' mnc = '1' includes_pcs_digit = 'no' ]
    >>>>>> TLV:
    >>>>>>   type       = "LTE TAC" (0x25)
    >>>>>>   length     = 2
    >>>>>>   value      = 08:01
    >>>>>>   translated = 264
    >>>>>> TLV:
    >>>>>>   type       = "Detailed Service Status" (0x22)
    >>>>>>   length     = 5
    >>>>>>   value      = 02:03:00:01:00
    >>>>>>   translated = [ status = 'available' capability = 'cs-ps' hdr_status = 'none' hdr_hybrid = 'yes' forbidden = 'no' ]
    >>>>>> TLV:
    >>>>>>   type       = "CID 3GPP" (0x1e)
    >>>>>>   length     = 4
    >>>>>>   value      = 01:A1:4D:04
    >>>>>>   translated = 72196353
    >>>>>> TLV:
    >>>>>>   type       = "LAC 3GPP" (0x1d)
    >>>>>>   length     = 2
    >>>>>>   value      = FE:FF
    >>>>>>   translated = 65534
    >>>>>> TLV:
    >>>>>>   type       = "Current PLMN" (0x12)
    >>>>>>   length     = 5
    >>>>>>   value      = D6:00:01:00:00
    >>>>>>   translated = [ mcc = '214' mnc = '1' description = '' ]
    >>>>>> TLV:
    >>>>>>   type       = "Data Service Capability" (0x11)
    >>>>>>   length     = 2
    >>>>>>   value      = 01:0B
    >>>>>>   translated = { [0] = 'lte '}
    >>>>>> TLV:
    >>>>>>   type       = "Serving System" (0x01)
    >>>>>>   length     = 6
    >>>>>>   value      = 01:01:01:02:01:08
    >>>>>>   translated = [ registration_state = 'registered' cs_attach_state = 'attached' ps_attach_state = 'attached' selected_network = '3gpp' radio_interfaces = '{ [0] = 'lte '}' ]
    <debug> [1444895382.427216] Processing 3GPP info...
    <info>  [1444895382.433423] Modem /org/freedesktop/ModemManager1/Modem/3: 3GPP Registration state changed (idle -> registering)

    [ Here we tried to update LAC/CID ]

    <debug> [1444895382.439668] Modem /org/freedesktop/ModemManager1/Modem/3: 3GPP location updated (MCC: '214', MNC: '1', Location area code: '0', Cell ID: '0')
    <info>  [1444895382.446788] Modem /org/freedesktop/ModemManager1/Modem/3: 3GPP Registration state changed (registering -> home)
    <info>  [1444895382.452383] Modem /org/freedesktop/ModemManager1/Modem/3: state changed (enabled -> registered)
2015-10-15 11:35:58 +02:00
Aleksander Morgado 0579ac076a mm-broadband-modem: trigger registration checks only after enabling all ifaces
Given that the Location interface requires 3GPP info reported by the 3GPP
interface, we should only trigger registration checks once the Location
interface has been already enabled and ready to be used. If we don't do this,
we'll end up e.g. getting initial MCCMNC values but never reaching the Location
interface properly.

So, fix this by triggering all registration checks (CDMA and 3GPP) only after
having enabled all interfaces.
2015-10-15 09:15:36 +02:00
Aleksander Morgado 1cb68c810e broadband-modem-qmi: LAC/CID not given in all serving system indications
LAC/CID may only be given in the serving system indications when the values
change, and therefore we shouldn't reset the values to 0 whenever they're not
reported.

This seems to happen in newer devices; older devices like the MC7710 did always
report the values in the indications.
2015-10-15 09:15:36 +02:00
Aleksander Morgado b35de2b15f modem-helpers-qmi: remove wrong check warning
This check makes no sense. We're converting from a ModemManager enum to a QMI
enum, nothing else; i.e. 'caps' is *not* the current capabilities of the modem.
2015-09-25 22:41:25 +02:00
Dan Williams 7cb3b3faad broadband-modem-qmi: update access technology from signal info for newest QMI commands 2015-09-24 14:54:45 -05:00
Aleksander Morgado d281b9bddb broadband-modem-qmi: fix invalid read
Breakpoint 2, g_log (log_domain=log_domain@entry=0x7ffff6ad744e "GLib", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7ffff6ae0c1d "%s: assertion '%s' failed") at gmessages.c:1075
    1075	{
    (gdb) bt
    #0  0x00007ffff6a71b20 in g_log (log_domain=log_domain@entry=0x7ffff6ad744e "GLib", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7ffff6ae0c1d "%s: assertion '%s' failed")
        at gmessages.c:1075
    #1  0x00007ffff6a71be9 in g_return_if_fail_warning (log_domain=log_domain@entry=0x7ffff6ad744e "GLib", pretty_function=pretty_function@entry=0x7ffff6b316a0 <__FUNCTION__.5266> "g_variant_new_string", expression=expression@entry=0x7ffff6b2f1e8 "g_utf8_validate (string, -1, NULL)") at gmessages.c:1088
    #2  0x00007ffff6a9e925 in g_variant_new_string (string=0x7cf850 "260\366\377\177") at gvariant.c:1230
    #3  0x00007ffff7068cfe in g_dbus_gvalue_to_gvariant (gvalue=gvalue@entry=0x7fffffffdec0, type=0x7ffff7b9df91) at gdbusutils.c:604
    #4  0x00007ffff7b8f1eb in _mm_gdbus_modem3gpp_skeleton_handle_get_property (connection=<optimized out>, sender=sender@entry=0x0, object_path=object_path@entry=0x7bd340 "/org/freedesktop/ModemManager1/Modem/1", interface_name=interface_name@entry=0x7ffff7b97320 "org.freedesktop.ModemManager1.Modem.Modem3gpp", property_name=property_name@entry=0x7ffff7baa0a4 "OperatorCode", error=error@entry=0x0, user_data=0x799ab0)
        at mm-gdbus-modem.c:19680
    #5  0x00007ffff7b8f894 in mm_gdbus_modem3gpp_skeleton_dbus_interface_get_properties (_skeleton=<optimized out>) at mm-gdbus-modem.c:19759
    #6  0x00007ffff708e791 in g_dbus_interface_skeleton_get_properties (interface_=0x799ab0 [MmGdbusModem3gppSkeleton]) at gdbusinterfaceskeleton.c:371
    #7  0x00007ffff70937a2 in manager_method_call (connection=<optimized out>, sender=sender@entry=0x7fffe0005200 ":1.270", object_path=object_path@entry=0x7fffe0002fd0 "/org/freedesktop/ModemManager1", interface_name=interface_name@entry=0x7fffe0002dd0 "org.freedesktop.DBus.ObjectManager", method_name=method_name@entry=0x7fffe00059e0 "GetManagedObjects", parameters=parameters@entry=0x7c1e70, invocation=0x7fffe0003260 [GDBusMethodInvocation], user_data=0x713cd0) at gdbusobjectmanagerserver.c:845
    #8  0x00007ffff7076aac in call_in_idle_cb (user_data=0x7fffe0003260) at gdbusconnection.c:4884
    #9  0x00007ffff6a6a7fb in g_main_context_dispatch (context=0x713a00) at gmain.c:3111
    #10 0x00007ffff6a6a7fb in g_main_context_dispatch (context=context@entry=0x713a00) at gmain.c:3710
    #11 0x00007ffff6a6ab98 in g_main_context_iterate (context=0x713a00, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3781
    #12 0x00007ffff6a6aec2 in g_main_loop_run (loop=0x71bf50) at gmain.c:3975
    #13 0x0000000000430e57 in main (argc=<optimized out>, argv=<optimized out>) at main.c:150
2015-09-24 21:13:26 +02:00
Aleksander Morgado b8245b5502 broadband-modem-qmi: don't warn on invalid ESN/MEIDs reported
The MC7304, which is a 3GPP only device, reports a ESN with value 0 in "DMS Get IDs":

    ModemManager[10121]: [/dev/cdc-wdm0] Received message (translated)...
    >>>>>> QMUX:
    >>>>>>   length  = 45
    >>>>>>   flags   = 0x80
    >>>>>>   service = "dms"
    >>>>>>   client  = 2
    >>>>>> QMI:
    >>>>>>   flags       = "response"
    >>>>>>   transaction = 6
    >>>>>>   tlv_length  = 33
    >>>>>>   message     = "Get IDs" (0x0025)
    >>>>>> TLV:
    >>>>>>   type       = "Result" (0x02)
    >>>>>>   length     = 4
    >>>>>>   value      = 00:00:00:00
    >>>>>>   translated = SUCCESS
    >>>>>> TLV:
    >>>>>>   type   = 0x13
    >>>>>>   length = 1
    >>>>>>   value  = 42
    >>>>>> TLV:
    >>>>>>   type       = "Esn" (0x10)
    >>>>>>   length     = 1
    >>>>>>   value      = 30
    >>>>>>   translated = 0
    >>>>>> TLV:
    >>>>>>   type       = "Imei" (0x11)
    >>>>>>   length     = 15
    >>>>>>   value      = <hidden>
    >>>>>>   translated = <hidden>
2015-09-23 21:24:30 +02:00
Aleksander Morgado 585320e0b4 tests: plug memleak in +CMGR response parser 2015-09-22 09:34:22 +02:00
Nick Stevens eaf65ed98d core: process SMS +CGMR response with regex
Variability in the response style from certain modems causes the parsing
of the +CGMR response to fail. For example, the Telit HE910 inserts an
empty string ("") in the second field of the response, causing the
sscanf implementation to fail.

This patch converts the parsing of the CGMR response to a regex that
allows for more flexibility and robustness, and adds unit tests around
the parsing call.

Signed-off-by: Nick Stevens <Nick.Stevens@digi.com>
2015-09-22 09:24:18 +02:00
Aleksander Morgado 8df7f83278 broadband-modem: minor coding style fixes 2015-09-15 16:34:50 +02:00