aboutsummaryrefslogtreecommitdiff
path: root/src/mm-serial-parsers.c
AgeCommit message (Collapse)Author
2022-09-05core: port GRegex/GMatchInfo to use autoptr()Aleksander Morgado
The behavior of GRegex changed in 2.73.2 once it was ported from pcre1 to pcre2. In some cases it was made more strict, which is fine, in other cases it exposed some change in how it behaves on certain matches that is not extremely clear whether it's ok or not. See https://gitlab.gnome.org/GNOME/glib/-/issues/2729 See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/601 See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/621 Either way, one thing that was assumed was that initializing all GRegex/GMatchInfo variables to NULL and making sure they're NULL before they're initialized by glib (especially the GMatchInfo) was a good and safer approach. So, whenever possible, g_autoptr() is used to cleanup the allocated GMatchInfo/GRegex variables, and otherwise, g_clear_pointer() is used to ensure that no free/unref is attempted unless the given variable is not NULL, and also so that the variable is reseted to NULL after being disposed.
2022-09-01serial-parsers: fix invalid EXZ error parserAleksander Morgado
Passed undetected when glib2 was using pcre1, it triggers an error now with pcre2. See https://gitlab.gnome.org/GNOME/glib/-/issues/2729#note_1542038 Reported and fix suggested by: Marco Trevisan (Treviño) <mail@3v1n0.net>
2020-12-01serial-parsers: also match ERROR responses that are not at end of lineDylan Van Assche
Do not fail to detect an error response with a call or text incoming. This happens during port probing when there's no URC parsers installed in the serial port. This probably will not happen when the serial port was managed by the modem object.w
2020-12-01serial-parsers: also match OK responses that are not at end of lineDylan Van Assche
Do not fail to detect a valid response with a call or text incoming. This happens also during port probing when there's no URC parsers installed in the serial port. This probably will not happen when the serial port was managed by the modem object.
2020-04-08error-helpers: port to use object loggingAleksander Morgado
2020-04-08serial-parsers: port to use object loggingAleksander Morgado
2013-06-25serial-parsers: plug memleakAleksander Morgado
2013-04-05serial-parser: detect 'NA' as a mobile equipment errorAleksander Morgado
Just treat 'NA' as MM_MOBILE_EQUIPMENT_ERROR_NOT_ALLOWED error. https://bugzilla.gnome.org/show_bug.cgi?id=697368
2013-04-04serial-parsers: allow specifying a custom response filterAleksander Morgado
The serial parser will now allow specifying a custom user-provided filter, which is applied before even trying to match successful/error responses. This filter provides a very early barrier to detect strings that are clearly not going to match. E.g. this filter may be used during port probing to early detect non-AT ports.
2012-08-24sms: fix sending SMS messages on some modemsAleksander Morgado
This is the port to git master of the following commit: commit 65f13f41cfd00cd38f118121a58b83713501f45f Author: Dan Williams <dcbw@redhat.com> Date: Tue Jul 17 16:00:31 2012 -0500 gsm: fix sending SMS messages on some modems and use PDU by default It turns out we really do have to wait for the modem to return the ">" prompt before sending the message data, otherwise a number of modems will complain about the data and fail the message. Fix that by sending the first bit of the CMGS, waiting for the ">", and then sending the rest. This also switches all modems over to PDU mode by default if they support it, since it's more compatible and most recent modems don't even bother to support text mode anyway.
2012-03-16serial-parsers: new method to check if a given error was set by the parserAleksander Morgado
2012-03-16serial-parsers: remove v0 and v1_e1 parsers, which are unusedAleksander Morgado
Given that we now perform our own built-in echo removal in the v1 parser, we no longer need the v1_e1 parser. The v0 parser was also unused from long ago.
2012-03-15core: start using our newly defined errorsAleksander Morgado
2012-01-16serial: handle CMS errors correctlyDan Williams
2011-12-30serial-parsers: plug small leakAleksander Morgado
2011-10-14serial: skip NUL bytes coming before real AT responsesAleksander Morgado
Some Cinterion modems send a NUL byte before the "CONNECTED" reply to "ATD" (only during the first ATD try anyway). This fix will ignore any NUL byte leading the real response.
2011-09-27core: ensure that GMatchInfo and GRegex objects are freed properlyNathan Williams
In particular, g_regex_match() and g_regex_match_full() allocate a match_info structure on both success and failure, so calling g_match_info_free() only in the success case is insufficient. BUG=None TEST=Inspection Change-Id: Iea76b5b5dc3ec48120e15601a5e2dd45322133d8
2011-06-02serial-parser: allow 0 or more whitespaces before error code in regular ↵Aleksander Morgado
expresions
2011-04-14Merge remote-tracking branch 'lanedo/plugin-wavecom'Dan Williams
2011-04-14gsm: implement basic SMS reception and PDU parsingNathan Williams
2011-04-11wavecom: handle READY without OK in CPIN? replyAleksander Morgado
2011-04-06serial: allow user to provide custom regex for successful and error repliesAleksander Morgado
New mm_serial_parser_v1_set_custom_regex() method.
2011-01-23core: rework loggingDan Williams
Make it more flexible, add logging to a file, and absolute and relative timestamps.
2010-10-25gsm: add SimIdentifier propertyDan Williams
An obfuscated SimIdentifier that may be available before the PIN has been entered, for use in auto-unlocking a device. If this value is present, it should be used in preference to DeviceIdentifier as it is SIM-specific like the PIN code.
2010-08-18gsm: recognize Motorola EZX errorsDan Williams
Nobody seems to know what the number means, but at least recognize them as errors.
2010-01-31serial: handle string CME error codes tooDan Williams
Some devices won't get to the initialization stage where we send CMEE=1 (for numeric error codes) before they return some errors, so handle the string representation of CME error codes too.
2009-11-24serial: handle arbitrary amounts of <CR><LF> padding in responsesJeroen Elebaut
Firmware on some Option devices (iCON 505) likes to spray newlines all over the place. Some fixes and boundary checks by me (dcbw).
2009-09-23generic: match CONNECT even if we get PPP spewDan Williams
Found by Eugene Crosser <crosser@average.org>
2009-08-06license: add license header to all files and set copyright based on git logAlexander Sack
2009-06-28asynchronous and deferred port detectionDan Williams
Allow plugins to perform asynchronous port detection, and to defer port detection until later. This moves the prober bits into MMPluginBase so that all plugins can take adavantage of it only when needed; the probing is not done at udev time. Furthermore, plugins like Novatel can flip the secondary ports over the AT mode through deferred detection, by deferring the secondary ports until the main port has been detected and AT$NWDMAT has been sent. This commit also finishes the port of the rest of the plugins (except mbm) over to the new port detection methods and plugin API.
2009-04-02Implement 'V1 E1' parser to work with modems which refuse to turn their echo ↵Tambet Ingo
off.
2009-02-10add --enable-more-warnings=yes/no and fix up resulting errorsDan Williams
2009-01-23Relax the "CONNECT" string regex a bit.Tambet Ingo
2008-10-24Add guards to public functions to validate passed arguments.Tambet Ingo
2008-09-17Finish the non-verbose (V0) mode parser.Tambet Ingo
2008-09-11Fix error codes.Tambet Ingo
2008-09-11Rewrite serial device communications.Tambet Ingo
Instead of vague "send something, wait something" the responses are now analyzed by (overridable) parsers. Makes all the modem implementations much easier since each caller knows without any code whether the call succeeded or failed. Another thing that makes modem code simpler (and the whole thing more robust), is the queueing of sent commands. Each queued command has a command and a callback which is quaranteed to get called, even if sending failed. Define and implement error reporting.