diff options
author | Mark-Jablonsky <mjablonsky1@gmail.com> | 2018-11-28 13:28:00 -0600 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2019-01-30 12:10:03 +0100 |
commit | c1aa658802940327369a6a4cc50d35a4a6a9b04e (patch) | |
tree | 43da81f94f2855020620a86710016f65c3450328 /plugins/ublox/mm-modem-helpers-ublox.h | |
parent | 2d80dbfbfedbb849dad09981f253d788aac9e5cd (diff) |
ublox: add band detection support for additional modems
The u-blox plugin was originally written to support the TOBY-L4 only.
This caused issues with mmcli reporting the correct supported and
current bands because the logic was based only for the TOBY-L4 and
the AT commands used in the implementaion are only supported by
a couple of modems.
There is now a hard-coded modem list that contains the supported bands
and the supported modes. A hard-coded list was chosen over a logic
based list because ublox modems only report the frequency of the bands
they support in the current mode they are in. For further justification,
the reported frequency could relate to multiple bands that are not all
supported by the modem, and not all the supported bands are always caught
depending on the mode the modem is in (e.g. 2G, 3G, 4G). The only
realiable way to retrieve the correct supported bands is to have the list
hard-coded. Based off of the modem, the code chooses whether it is
appropriate to issue +UACT or +UBANDSEL to retrieve the current bands list.
Additionally, the appropriate AT command of +CFUN=4 or +COPS=2 is chosen
to detach from the network when the mmcli --set-current-bands command is
issued. The new setup also adds a header file that contains the modem list.
This should make adding support for future additional modems easier as long
as future modems stick to the same AT command interface that is currently
supported by the plugin.
Diffstat (limited to 'plugins/ublox/mm-modem-helpers-ublox.h')
-rw-r--r-- | plugins/ublox/mm-modem-helpers-ublox.h | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/plugins/ublox/mm-modem-helpers-ublox.h b/plugins/ublox/mm-modem-helpers-ublox.h index 1a51df38..d47fd41e 100644 --- a/plugins/ublox/mm-modem-helpers-ublox.h +++ b/plugins/ublox/mm-modem-helpers-ublox.h @@ -20,6 +20,27 @@ #include <ModemManager.h> /*****************************************************************************/ +/* AT Commands Support */ + +typedef enum { + FEATURE_SUPPORT_UNKNOWN, + FEATURE_SUPPORTED, + FEATURE_UNSUPPORTED, +} FeatureSupport; + +typedef enum { + BAND_UPDATE_NEEDS_UNKNOWN, + BAND_UPDATE_NEEDS_CFUN, + BAND_UPDATE_NEEDS_COPS, +} UpdateMethod; + +typedef struct UbloxSupportConfig { + UpdateMethod method; + FeatureSupport uact; + FeatureSupport ubandsel; +} UbloxSupportConfig; + +/*****************************************************************************/ /* +UPINCNT response parser */ gboolean mm_ublox_parse_upincnt_response (const gchar *response, @@ -82,6 +103,12 @@ GArray *mm_ublox_parse_urat_test_response (const gchar *response, GError **error); /*****************************************************************************/ +/* Model-based config support loading */ +gboolean mm_ublox_get_support_config (const gchar *model, + UbloxSupportConfig *config, + GError **error); + +/*****************************************************************************/ /* Model-based supported modes filtering */ GArray *mm_ublox_filter_supported_modes (const gchar *model, @@ -91,20 +118,22 @@ GArray *mm_ublox_filter_supported_modes (const gchar *model, /*****************************************************************************/ /* Model-based supported bands loading */ -GArray *mm_ublox_get_supported_bands (const gchar *model, - GError **error); +GArray *mm_ublox_get_supported_bands (const gchar *model, + GError **error); /*****************************************************************************/ /* UBANDSEL? response parser */ GArray *mm_ublox_parse_ubandsel_response (const gchar *response, + const gchar *model, GError **error); /*****************************************************************************/ /* UBANDSEL=X command builder */ -gchar *mm_ublox_build_ubandsel_set_command (GArray *bands, - GError **error); +gchar *mm_ublox_build_ubandsel_set_command (GArray *bands, + const gchar *model, + GError **error); /*****************************************************************************/ /* UACT? response parser */ |