Commit Graph
18 Commits
Author SHA1 Message Date
Florian Eckert 44b9f74301 mm-port-serial: add new MM_SERIAL_ERROR_SEND_TIMEOUT
This new error code 'MM_SERIAL_ERROR_SEND_TIMEOUT' is used to make it easier
to distinguish why the transmission failed. Until now,
'MM_SERIAL_ERROR_SEND_FAILED' was always returned. This new error code is now
returned for an 'EAGAIN', as this is more likely to be a TIMEOUT.

This makes debugging easier, as a better error analysis is now possible.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2025-06-02 08:43:45 -05:00
Guido Günther 68933455df treewide: Fix typos
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-03-11 23:15:57 +01:00
Aleksander Morgado 1f9a04268f core: ensure all errors returned in DBus operations are normalized
We want to ensure that all errors reported via DBus operations are
normalized to MM-specific errors.

We don't want to return QMI or MBIM specific errors, as those are
protocol specific and we don't want DBus clients to need to rely on
knowing which is the protocol in use by the device.
2023-10-27 11:34:26 +02:00
Aleksander Morgado 2de0763ac8 api,errors: new MMCarrierLockError type
This new error type will be used to report errors in the carrier lock
operations performed through ModemManager.

They have a one to one mapping to the MBIM status specific errors.
2023-10-27 07:33:44 +00:00
Aleksander Morgado bfb0658909 modem-helpers-qmi: register QMI error translations
We register translations for QMI core and QMI protocol errors. These
translations are a best-effort, and they are not meant to be
exhaustive.

The original error description is included in the translated GError,
so that the details of the issue are not lost.
2023-10-26 12:35:50 +00:00
Aleksander Morgado cbb825a236 modem-helpers-mbim: register MBIM error translations
We register translations for MBIM core, MBIM protocol and MBIM status
errors. These translations are a best-effort, and they are not meant
to be exhaustive.

The original error description is included in the translated GError,
so that the details of the issue are not lost.
2023-10-26 12:35:50 +00:00
Aleksander Morgado 81d2655950 error-helpers: allow registering error mappings
E.g. from QMI/MBIM errors into MM errors.
2023-10-26 12:35:50 +00:00
Aleksander Morgado 59aae421a1 core,error-helpers: new method to normalize GErrors
The ModemManager API should not expose or return error types out of
the error domains it supports.

Default to a generic core error "Failed", while keeping the original
error description.
2023-10-26 12:35:50 +00:00
Aleksander Morgado f730238a92 core,error-helpers: fix formatting in ME error strings 2023-10-25 12:44:14 +00:00
Aleksander Morgado 8da8fd0248 api: update MMMobileEquipmentError enum values
Update the list of mobile equipment error codes according to v17.1.0
of 3GPP TS 27.007 (March 2021).

A lot of the enum values that were prefixed with the 'GPRS_' keyword
have now been flagged as deprecated, and a new enum name given to the
corresponding value.

The deprecated symbol names are kept in the compat support to avoid
breaking API/ABI.
2021-05-22 22:58:37 +00:00
Aleksander Morgado d1bd0a2971 core: improve error helpers
First, simplify the logic that attempts to find the correct error code
associated to an error text string. This logic is very flaky, as it
relies on knowing what the modems report as text string for the
different error codes, and obviously that is not always the same.
Instead of supporting all error codes in this logic, we now limit them
to a small subset with common error codes and hopefully common error
strings.

Second, in order to quickly get the error description string for a
given error code, we rework the array of supported errors so that
the index of the array is the error code itself. For mobile equipment
errors the logic is straightforward, as they're always in the [0,255]
range, but for the message errors we create an array where the index
of the array is equal to the code plus 300 as they're always in the
[300,500] range. By doing this, we avoid having an array with 300 NULL
items before the actual values we want to support.
2021-05-22 22:58:37 +00:00
Aleksander Morgado a2b57474dc error-helpers: port to use object logging 2020-04-08 16:35:09 +02:00
Aleksander Morgado 9991f2906f core,error-helpers: add missing ME error codes 2019-12-17 10:52:13 +01:00
Aleksander Morgado 7fb366c41a core: use MM-specific logging methods always instead of the generic GLib ones 2016-08-15 13:14:47 +02:00
Aleksander Morgado 0ff4da71e3 error-helpers: don't warn when unknown errors are found
Just add the messages with debug level, so that they don't get reported at
syslog. Having this kind of warnings in syslog is not useful, specially because
we wouldn't know which was the specific command that issued the warning. Errors
due to critical issues will anyway be reported in syslog in some way or another.
2013-09-11 17:00:43 +02:00
Aleksander Morgado 0b39072b76 error-helpers: avoid crash when error is not recognized
Just remove the last element with NULL strings in the array of errors, as we're
safe using G_N_ELEMENTS() to iterate it.

Reported by Jose Maria Gonzalez Calabozo <jmgonzalezc@indra.es>
2013-03-20 18:16:10 +01:00
Aleksander Morgado 0c64e08f85 error-helpers: small refactor 2012-03-15 14:14:31 +01:00
Aleksander Morgado c58db4e015 core: start using our newly defined errors 2012-03-15 14:14:25 +01:00