aboutsummaryrefslogtreecommitdiff
path: root/src/mm-modem-helpers.h
AgeCommit message (Collapse)Author
2018-09-12modem-helpers: add flow control udev tag parserAlfonso Sánchez-Beato
Add function for parsing the content of the udev tag ID_MM_TTY_FLOW_CONTROL.
2018-09-12iface-modem-location: validate SUPL server addressAleksander Morgado
Devices will expect SUPL server given as either IP:PORT or FQDN:PORT, so just avoid saying we require a 'URL' because it's not true. We will use a new helper method to parse and validate user-provided SUPL server address.
2018-01-20broadband-modem: implement support for the +CEMODE commandAleksander Morgado
The +CEMODE command is defined in 3GPP TS 27.007 (e.g. in section 10.1.28 in v11.0.0). This command allows querying or updating the current UE mode, as well as checking the supported modes. We implement support for loading the current mode and updating it. It is assumed that the device does any additional operation needed by the setting update, e.g. un-registering from CS when selecting an EPS-only mode.
2018-01-01helpers: move generic load_unlock_retries from Telit pluginColin Helliwell
As a precursor to a generic load_unlock_retries method, move the CSIM Response parser from the Telit plugin into the core code.
2017-07-19helpers: +CNUM parser doesn't return any errorAleksander Morgado
2017-07-14modem-helpers: minor coding style fixesBen Chan
2017-05-29helpers: new 'AT+CMER=?' parserAleksander Morgado
2017-04-18broadband-bearer: once connected, set flow control settingsAleksander Morgado
During modem initialization we detected the flow control settings supported by the modem, and selected the best one to use from them, notifying it to the device via AT+IFC. The device was therefore instructed to use that flow control setting for data transmission in the TTY (i.e. not during AT control commands). The missing thing was to also configure ourselves our end of the serial port with the same flow control settings when getting into data mode. By doing it ourselves, we avoid requiring any explicit setting in pppd for flow control; pppd can assume the flow control settings are already the expected ones. Worth noting that all this setup is completely ignored for TTYs exposed directly via USB. https://bugs.freedesktop.org/show_bug.cgi?id=100394
2017-04-18helpers: new parser for AT+IFC=?Aleksander Morgado
Instead of having the parser return separate list of supported flow controls for TE and TA, we simplify it by only returning those settings that apply to both TE and TA. This logic isn't perfect either, though, as some settings (e.g. '3' in TE in some modems, specifying a different XON/XOFF behavior) may not have a corresponding setting in the other end. The most common cases we care about (i.e. standard XON/XOFF, RTS/CTS) should be properly reported with this logic.
2017-04-02broadband-modem: normalize also operator codeAleksander Morgado
The operator code (MCCMNC) may also be given encoded in the current charset (e.g. UCS2). Based on a patch from Colin Helliwell <colin.helliwell@ln-systems.com>
2017-03-24broadband-modem,helpers: implement AT+WS46=? response parserAleksander Morgado
We want a parser that returns the full list of combinations found.
2016-10-12modem-helpers: implement less strict APN comparisonAleksander Morgado
u-blox modems will append a string showing the MCC and MNC info to the access point name listed in AT+CGDCONT? responses. We will try to detect when that happens, and we just accept the match. The logic doesn't just look for a string prefix; it also looks for the special MCC + MNC suffix, which is much more restrictive, to try to avoid false positives.
2016-10-12modem-helpers: new helper to parse +CESQ response into MMSignal objectsAleksander Morgado
2016-10-12modem-helpers: new +CESQ response parserAleksander Morgado
2016-10-12modem-helpers: new +CFUN? response parserAleksander Morgado
2016-10-12modem-helpers: new uint list parser, including interval supportAleksander Morgado
2016-10-12modem-helpers: new CGACT? response parserAleksander Morgado
2016-10-12modem-helpers: new COPS? response parserAleksander Morgado
Split into two different actions the actual COPS? response parsing and the operator name normalization process. Also, allow parsing not only the operator string, but also the format, mode and the optional access technology value.
2016-10-12modem-helpers: new +CGCONTRDP=N response parserAleksander Morgado
2016-03-09broadband-modem: fix +CPMS empty parameter supportCarlo Lobrano
* Add new async virtual method init_current_storages to MMIfaceModemMessaging * Add logic of init_current_storages to MMBroadbandModem * Add step "INIT_CURRENT_STORAGES" in MMIfaceModemMessaging initialization in order to load and store current SMS storages for mem1 and mem2. * Add usage of current sms storage value for mem1 in place of an empty string parameter when the command AT+CPMS is used. https://bugs.freedesktop.org/show_bug.cgi?id=93135
2016-02-13helpers: move +CRSM parsing to mm_3gpp_parse_crsm_responseThomas Sailer
Also added test cases. Signed-off-by: Thomas Sailer <t.sailer@alumni.ethz.ch>
2016-01-10mbm: query supported modes to the modem with +CFUN=?Aleksander Morgado
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.
2015-09-22core: process SMS +CGMR response with regexNick Stevens
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-08-02core,voice: remove explicit "NO CARRIER" response matchingAleksander Morgado
This response is already managed by the generic AT serial port and translates it into a proper error. This change also avoids the Call.Start() call to report a timeout in the serial port, instead we get a proper no-carrier error. Before: $ sudo mmcli -m 0 --voice-create-call="number=12345678" Successfully created new call: /org/freedesktop/ModemManager1/Call/1 outgoing (unknown) $ sudo mmcli -o 1 --start error: couldn't start the call: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Serial.ResponseTimeout: Serial command timed out' After: $ sudo mmcli -m 0 --voice-create-call="number=12345678" Successfully created new call: /org/freedesktop/ModemManager1/Call/1 outgoing (unknown) $ sudo mmcli -o 1 --start error: couldn't start the call: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Connection.NoCarrier: No carrier'
2015-08-02core,voice: minor coding style fixesAleksander Morgado
2015-08-02huawei: acquire incoming DTMF on active callMarco Bascetta
2015-08-02core: handle incoming calls (RING/CRING, CLIP, NO CARRIER).Marco Bascetta
2015-08-02broadband-modem: added voice call supportRiccardo Vangelisti
2015-03-23broadband-modem: default implementation of the network time interfaceJason Simmons
Add a default implementation that queries the real-time clock using the AT+CCLK? command. Also set AT+CTZU=1 in case a modem requires it.
2013-09-26modem-helpers,sim: auto-detect if ICCID response is character swappedBen Chan
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.
2013-09-10core: add helper for parsing and validating the ICCIDDan Williams
2013-06-05api,introspection: rename 'ModemCapabilities' to 'SupportedCapabilities'Aleksander Morgado
And also make it a list of masks, specifying which are the specific combinations supported, not just one mask with all. E.g.: ------------------------- Hardware | manufacturer: 'Sierra Wireless, Incorporated' | model: 'MC7710' | revision: 'SWI9200X_03.05.19.04ap r5475 carmd-en-10527 2012/09/17 17:57:14' | supported: 'gsm-umts | gsm-umts, lte' | current: 'gsm-umts, lte' | equipment id: '358178040668164'
2013-06-05api,introspection: 'SupportedModes' is now a list of possible combinationsAleksander Morgado
Instead of just a mask of MMModemMode values, we now provide a list of the allowed and preferred mode combinations supported by the modem. E.g.: $> sudo mmcli -m 0 ------------------------- Modes | supported: 'allowed: 2g; preferred: none | allowed: 3g; preferred: none | allowed: 2g, 3g; preferred: none | allowed: 2g, 3g; preferred: 2g | allowed: 2g, 3g; preferred: 3g | allowed: 4g; preferred: none | allowed: 2g, 3g, 4g; preferred: none'
2013-06-05modem-helpers: new CGDCONT=? test response parserAleksander Morgado
2013-04-25time: normalize GetNetworkTime() response to local time + timezone info (bgo ↵Dan Williams
#697372) The GetNetworkTime() response is defined to be an ISO8601 string, which is in turn defined to be in local time. Make sure that's reflected in the documentation, and append the timezone offset to UTC where we have it. Oddly, Icera devices return their time info in UTC with an offset to the local timezone, so we have to jump through some hoops there to convert the response to localtime based on the reported offset. Some additional fixes by Aleksander Morgado <aleksander@lanedo.com>. https://bugzilla.gnome.org/show_bug.cgi?id=697372
2013-04-02broadband-modem: update CMGL parsing logicAleksander Morgado
Pantech UMW190 modem uses a custom +CMGL response which includes only three fields before the actual PDU, e.g: +CMGL: <index>,<status>,<something>\r\n<PDU> instead of what we had before: +CMGL: <index>,<status>,<alpha>,<length>\r\n<PDU> The CMGL parsing logic is now updated to use a regex to match the reply, and also considering the UMW190 specific case. Actually, we end up reading only the two first fields (index and status) which are the ones we really need, so we skip the <length> and the <alpha> if given. Added also unit tests to cover all these known cases. Partially fixes https://bugzilla.gnome.org/show_bug.cgi?id=696723 (missing the actual PDU parsing fixes).
2013-03-27broadband-modem: parse +GSN response for IMEI, MEID, and ESN (bgo #696596)Dan Williams
+GSN response differs widely between modems. Some prefix the MEID and/or ESN with 0x, some have leading zeros, some return the MEID and the ESN, and some append the serial number to the end of the IMEI. Handle that and make the ESN, MEID, IMEI, and EquipmentIdentifier parsing consistent.
2013-02-15modem: use +CEREG to determine EPS network registration statusBen Chan
This patch adds the support for solicited/unsolicited EPS network registration status via AT+CEREG, which is configurable via the 'iface-modem-3gpp-eps-network-supported' property of the MMIfaceModem3gpp interface and is disabled by default.
2012-10-22iface-modem: always ensure that current bands is a subset of supported bandsAleksander Morgado
In QMI modems the logic behind supported and current bands is completely separated in different services (DMS vs NAS). Actually, the list reported by NAS as current band preferences seems to include more values than the ones reported by DMS as supported bands (e.g. CDMA bands are reported even if the firmware image is GSM/HSPA only). So, just clean up the list of current preferred bands so that no more than those given as supported is used.
2012-09-19broadband-modem: skip +CGMM: prefix when loading device modelAleksander Morgado
Some devices, e.g. ZTE MF820D, seem to prefix the `AT+CGMM?' response with the `+CGMM:' string, resulting in the following model string being loaded: model: '+CGMM: "MF820D"' Avoid this by: 1) Removing the expected prefixes. 2) Unquoting the resulting string. Reported by: Marius Kotsbak <marius.kotsbak@gmail.com>
2012-09-14broadband-modem: process not-stored SMS part indicationsAleksander Morgado
2012-08-31modem-helpers: new helper to convert from netmask string to CIDRAleksander Morgado
2012-08-29modem-helpers: new method to validate and/or parse MCC/MNC operator ID stringAleksander Morgado
2012-08-23modem-helpers: ERI parser is generic enough, not just for !SPERIAleksander Morgado
2012-08-22api,dbus: 'ip-type' property now given as a MMBearerIpFamily (u)Aleksander Morgado
Instead of using a predefined set of string values for 'ip-type' in Modem.CreateBearer() and Simple.Connect(), we'll use an enumeration. The implementation will then need to convert the requested IP family type to e.g. the correct PDP type in 3GPP modems. This change also consolidates the use of enums in dictionary properties when possible to do so, as with the Rm Protocol.
2012-05-04modem-helpers: recognize 3GPP2 access tech strings tooDan Williams
Various Gobi-based devices (USB551L, probably Gobis too) can report EVDO and 1X as the current RAT from CNTI so parse that here too.
2012-03-18libmm-common: new common uint/int/str parsersAleksander Morgado
2012-03-16modem-helpers: refactor and reorganize sourcesAleksander Morgado
2012-03-16modem-helpers: new +CNUM response parser and testsAleksander Morgado
2012-03-16modem-helpers: port facility lock related helpers to use `MMModemFacility' enumsAleksander Morgado