diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2020-01-31 10:36:50 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2020-01-31 15:18:35 +0100 |
commit | accd1a5841bafc81aa87db46eb35a8255ced4e22 (patch) | |
tree | 32c0ccb8d755242c4de104699813b9edf88450fe /plugins | |
parent | f77deb75a5d81fb1cfbfff576838900be866d016 (diff) |
base-modem: define new helper MMBaseModemAtCommandAlloc
It has the same exact format as MMBaseModemAtCommand, but its contents
are assumed heap allocated.
The only real purpose of this type is to allow defining static
constant MMBaseModemAtCommand variables without warnings when using
-Wdiscarded-qualifiers.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/altair/mm-broadband-modem-altair-lte.c | 12 | ||||
-rw-r--r-- | plugins/huawei/mm-broadband-modem-huawei.c | 12 | ||||
-rw-r--r-- | plugins/icera/mm-broadband-modem-icera.c | 8 | ||||
-rw-r--r-- | plugins/mbm/mm-broadband-modem-mbm.c | 36 | ||||
-rw-r--r-- | plugins/mtk/mm-broadband-modem-mtk.c | 4 | ||||
-rw-r--r-- | plugins/novatel/mm-broadband-modem-novatel-lte.c | 4 | ||||
-rw-r--r-- | plugins/option/mm-broadband-modem-option.c | 16 | ||||
-rw-r--r-- | plugins/sierra/mm-broadband-modem-sierra.c | 4 | ||||
-rw-r--r-- | plugins/telit/mm-broadband-modem-telit.c | 4 |
9 files changed, 50 insertions, 50 deletions
diff --git a/plugins/altair/mm-broadband-modem-altair-lte.c b/plugins/altair/mm-broadband-modem-altair-lte.c index 669b7d2d..03912eae 100644 --- a/plugins/altair/mm-broadband-modem-altair-lte.c +++ b/plugins/altair/mm-broadband-modem-altair-lte.c @@ -883,9 +883,9 @@ response_processor_no_result_stop_on_error (MMBaseModem *self, } static const MMBaseModemAtCommand unsolicited_events_enable_sequence[] = { - { (gchar *) "%STATCM=1", 10, FALSE, response_processor_no_result_stop_on_error }, - { (gchar *) "%NOTIFYEV=\"SIMREFRESH\",1", 10, FALSE, NULL }, - { (gchar *) "%PCOINFO=1", 10, FALSE, NULL }, + { "%STATCM=1", 10, FALSE, response_processor_no_result_stop_on_error }, + { "%NOTIFYEV=\"SIMREFRESH\",1", 10, FALSE, NULL }, + { "%PCOINFO=1", 10, FALSE, NULL }, { NULL } }; @@ -955,9 +955,9 @@ modem_3gpp_enable_unsolicited_events (MMIfaceModem3gpp *self, /* Disabling unsolicited events (3GPP interface) */ static const MMBaseModemAtCommand unsolicited_events_disable_sequence[] = { - { (gchar *) "%STATCM=0", 10, FALSE, NULL }, - { (gchar *) "%NOTIFYEV=\"SIMREFRESH\",0", 10, FALSE, NULL }, - { (gchar *) "%PCOINFO=0", 10, FALSE, NULL }, + { "%STATCM=0", 10, FALSE, NULL }, + { "%NOTIFYEV=\"SIMREFRESH\",0", 10, FALSE, NULL }, + { "%PCOINFO=0", 10, FALSE, NULL }, { NULL } }; diff --git a/plugins/huawei/mm-broadband-modem-huawei.c b/plugins/huawei/mm-broadband-modem-huawei.c index a16a31dc..20e5fe50 100644 --- a/plugins/huawei/mm-broadband-modem-huawei.c +++ b/plugins/huawei/mm-broadband-modem-huawei.c @@ -2013,8 +2013,8 @@ own_enable_unsolicited_events_ready (MMBaseModem *self, static const MMBaseModemAtCommand unsolicited_enable_sequence[] = { /* With ^PORTSEL we specify whether we want the PCUI port (0) or the * modem port (1) to receive the unsolicited messages */ - { (gchar *) "^PORTSEL=0", 5, FALSE, NULL }, - { (gchar *) "^CURC=1", 3, FALSE, NULL }, + { "^PORTSEL=0", 5, FALSE, NULL }, + { "^CURC=1", 3, FALSE, NULL }, { NULL } }; @@ -3363,7 +3363,7 @@ own_voice_enable_unsolicited_events_ready (MMBaseModem *self, static const MMBaseModemAtCommand unsolicited_voice_enable_sequence[] = { /* With ^DDTMFCFG we active the DTMF Decoder */ - { (gchar *) "^DDTMFCFG=0,1", 3, FALSE, NULL }, + { "^DDTMFCFG=0,1", 3, FALSE, NULL }, { NULL } }; @@ -3436,7 +3436,7 @@ own_voice_disable_unsolicited_events_ready (MMBaseModem *self, static const MMBaseModemAtCommand unsolicited_voice_disable_sequence[] = { /* With ^DDTMFCFG we deactivate the DTMF Decoder */ - { (gchar *) "^DDTMFCFG=1,0", 3, FALSE, NULL }, + { "^DDTMFCFG=1,0", 3, FALSE, NULL }, { NULL } }; @@ -4187,8 +4187,8 @@ modem_check_time_reply (MMBaseModem *_self, } static const MMBaseModemAtCommand time_cmd_sequence[] = { - { (gchar *) "^NTCT?", 3, FALSE, modem_check_time_reply }, /* 3GPP/LTE */ - { (gchar *) "^TIME", 3, FALSE, modem_check_time_reply }, /* CDMA */ + { "^NTCT?", 3, FALSE, modem_check_time_reply }, /* 3GPP/LTE */ + { "^TIME", 3, FALSE, modem_check_time_reply }, /* CDMA */ { NULL } }; diff --git a/plugins/icera/mm-broadband-modem-icera.c b/plugins/icera/mm-broadband-modem-icera.c index d0a9bd90..c57ffa75 100644 --- a/plugins/icera/mm-broadband-modem-icera.c +++ b/plugins/icera/mm-broadband-modem-icera.c @@ -1161,7 +1161,7 @@ parse_bands (const gchar *response, guint32 *out_len) /* Load supported bands (Modem interface) */ typedef struct { - MMBaseModemAtCommand *cmds; + MMBaseModemAtCommandAlloc *cmds; GSList *check_bands; GSList *enabled_bands; guint32 idx; @@ -1173,7 +1173,7 @@ supported_bands_context_free (SupportedBandsContext *ctx) guint i; for (i = 0; ctx->cmds[i].command; i++) - g_free (ctx->cmds[i].command); + mm_base_modem_at_command_alloc_clear (&ctx->cmds[i]); g_free (ctx->cmds); g_slist_free_full (ctx->check_bands, (GDestroyNotify) band_free); g_slist_free_full (ctx->enabled_bands, (GDestroyNotify) band_free); @@ -1272,7 +1272,7 @@ load_supported_bands_get_current_bands_ready (MMIfaceModem *self, * to its current enabled/disabled state. */ iter = ctx->check_bands = parse_bands (response, &len); - ctx->cmds = g_new0 (MMBaseModemAtCommand, len + 1); + ctx->cmds = g_new0 (MMBaseModemAtCommandAlloc, len + 1); while (iter) { Band *b = iter->data; @@ -1296,7 +1296,7 @@ load_supported_bands_get_current_bands_ready (MMIfaceModem *self, } mm_base_modem_at_sequence (MM_BASE_MODEM (self), - ctx->cmds, + (const MMBaseModemAtCommand *)ctx->cmds, ctx, (GDestroyNotify) supported_bands_context_free, (GAsyncReadyCallback) load_supported_bands_ready, diff --git a/plugins/mbm/mm-broadband-modem-mbm.c b/plugins/mbm/mm-broadband-modem-mbm.c index f38f27d6..a4b89fd4 100644 --- a/plugins/mbm/mm-broadband-modem-mbm.c +++ b/plugins/mbm/mm-broadband-modem-mbm.c @@ -406,9 +406,9 @@ enabling_init_sequence_ready (MMBaseModem *self, static const MMBaseModemAtCommand enabling_modem_init_sequence[] = { /* Init command */ - { (gchar *) "&F", 3, FALSE, NULL }, + { "&F", 3, FALSE, NULL }, /* Ensure disconnected */ - { (gchar *) "*ENAP=0", 3, FALSE, NULL }, + { "*ENAP=0", 3, FALSE, NULL }, { NULL } }; @@ -614,18 +614,18 @@ factory_reset_finish (MMIfaceModem *self, static const MMBaseModemAtCommand factory_reset_sequence[] = { /* Init command */ - { (gchar *) "&F +CMEE=0", 3, FALSE, NULL }, - { (gchar *) "+COPS=0", 3, FALSE, NULL }, - { (gchar *) "+CR=0", 3, FALSE, NULL }, - { (gchar *) "+CRC=0", 3, FALSE, NULL }, - { (gchar *) "+CREG=0", 3, FALSE, NULL }, - { (gchar *) "+CMER=0", 3, FALSE, NULL }, - { (gchar *) "*EPEE=0", 3, FALSE, NULL }, - { (gchar *) "+CNMI=2, 0, 0, 0, 0", 3, FALSE, NULL }, - { (gchar *) "+CGREG=0", 3, FALSE, NULL }, - { (gchar *) "*EIAD=0", 3, FALSE, NULL }, - { (gchar *) "+CGSMS=3", 3, FALSE, NULL }, - { (gchar *) "+CSCA=\"\",129", 3, FALSE, NULL }, + { "&F +CMEE=0", 3, FALSE, NULL }, + { "+COPS=0", 3, FALSE, NULL }, + { "+CR=0", 3, FALSE, NULL }, + { "+CRC=0", 3, FALSE, NULL }, + { "+CREG=0", 3, FALSE, NULL }, + { "+CMER=0", 3, FALSE, NULL }, + { "*EPEE=0", 3, FALSE, NULL }, + { "+CNMI=2, 0, 0, 0, 0", 3, FALSE, NULL }, + { "+CGREG=0", 3, FALSE, NULL }, + { "*EIAD=0", 3, FALSE, NULL }, + { "+CGSMS=3", 3, FALSE, NULL }, + { "+CSCA=\"\",129", 3, FALSE, NULL }, { NULL } }; @@ -943,8 +943,8 @@ own_enable_unsolicited_events_ready (MMBaseModem *self, } static const MMBaseModemAtCommand unsolicited_enable_sequence[] = { - { (gchar *) "*ERINFO=1", 5, FALSE, NULL }, - { (gchar *) "*E2NAP=1", 5, FALSE, NULL }, + { "*ERINFO=1", 5, FALSE, NULL }, + { "*E2NAP=1", 5, FALSE, NULL }, { NULL } }; @@ -1033,8 +1033,8 @@ own_disable_unsolicited_events_ready (MMBaseModem *self, } static const MMBaseModemAtCommand unsolicited_disable_sequence[] = { - { (gchar *) "*ERINFO=0", 5, FALSE, NULL }, - { (gchar *) "*E2NAP=0", 5, FALSE, NULL }, + { "*ERINFO=0", 5, FALSE, NULL }, + { "*E2NAP=0", 5, FALSE, NULL }, { NULL } }; diff --git a/plugins/mtk/mm-broadband-modem-mtk.c b/plugins/mtk/mm-broadband-modem-mtk.c index 9b4ab759..8170984c 100644 --- a/plugins/mtk/mm-broadband-modem-mtk.c +++ b/plugins/mtk/mm-broadband-modem-mtk.c @@ -724,13 +724,13 @@ modem_3gpp_cleanup_unsolicited_events (MMIfaceModem3gpp *self, static const MMBaseModemAtCommand unsolicited_enable_sequence[] = { /* enable signal URC */ - { (gchar *) "+ECSQ=2", 5, FALSE, NULL }, + { "+ECSQ=2", 5, FALSE, NULL }, { NULL } }; static const MMBaseModemAtCommand unsolicited_disable_sequence[] = { /* disable signal URC */ - { (gchar *) "+ECSQ=0" , 5, FALSE, NULL }, + { "+ECSQ=0" , 5, FALSE, NULL }, { NULL } }; diff --git a/plugins/novatel/mm-broadband-modem-novatel-lte.c b/plugins/novatel/mm-broadband-modem-novatel-lte.c index 65433e49..6b5d0490 100644 --- a/plugins/novatel/mm-broadband-modem-novatel-lte.c +++ b/plugins/novatel/mm-broadband-modem-novatel-lte.c @@ -246,8 +246,8 @@ response_processor_nwmdn_ignore_at_errors (MMBaseModem *self, } static const MMBaseModemAtCommand own_numbers_commands[] = { - { (gchar *) "+CNUM", 3, TRUE, response_processor_cnum_ignore_at_errors }, - { (gchar *) "$NWMDN", 3, TRUE, response_processor_nwmdn_ignore_at_errors }, + { "+CNUM", 3, TRUE, response_processor_cnum_ignore_at_errors }, + { "$NWMDN", 3, TRUE, response_processor_nwmdn_ignore_at_errors }, { NULL } }; diff --git a/plugins/option/mm-broadband-modem-option.c b/plugins/option/mm-broadband-modem-option.c index 268cb531..eaf5a00c 100644 --- a/plugins/option/mm-broadband-modem-option.c +++ b/plugins/option/mm-broadband-modem-option.c @@ -975,10 +975,10 @@ own_enable_unsolicited_events_ready (MMBaseModem *self, } static const MMBaseModemAtCommand unsolicited_enable_sequence[] = { - { (gchar *) "_OSSYS=1", 3, FALSE, NULL }, - { (gchar *) "_OCTI=1", 3, FALSE, NULL }, - { (gchar *) "_OUWCTI=1", 3, FALSE, NULL }, - { (gchar *) "_OSQI=1", 3, FALSE, NULL }, + { "_OSSYS=1", 3, FALSE, NULL }, + { "_OCTI=1", 3, FALSE, NULL }, + { "_OUWCTI=1", 3, FALSE, NULL }, + { "_OSQI=1", 3, FALSE, NULL }, { NULL } }; @@ -1030,10 +1030,10 @@ modem_3gpp_disable_unsolicited_events_finish (MMIfaceModem3gpp *self, } static const MMBaseModemAtCommand unsolicited_disable_sequence[] = { - { (gchar *) "_OSSYS=0", 3, FALSE, NULL }, - { (gchar *) "_OCTI=0", 3, FALSE, NULL }, - { (gchar *) "_OUWCTI=0", 3, FALSE, NULL }, - { (gchar *) "_OSQI=0", 3, FALSE, NULL }, + { "_OSSYS=0", 3, FALSE, NULL }, + { "_OCTI=0", 3, FALSE, NULL }, + { "_OUWCTI=0", 3, FALSE, NULL }, + { "_OSQI=0", 3, FALSE, NULL }, { NULL } }; diff --git a/plugins/sierra/mm-broadband-modem-sierra.c b/plugins/sierra/mm-broadband-modem-sierra.c index 5ba89e6c..c1ac89ab 100644 --- a/plugins/sierra/mm-broadband-modem-sierra.c +++ b/plugins/sierra/mm-broadband-modem-sierra.c @@ -1805,8 +1805,8 @@ parse_time_reply (MMBaseModem *self, } static const MMBaseModemAtCommand time_check_sequence[] = { - { (gchar *) "!TIME?", 3, FALSE, parse_time_reply }, /* 3GPP */ - { (gchar *) "!SYSTIME?", 3, FALSE, parse_time_reply }, /* CDMA */ + { "!TIME?", 3, FALSE, parse_time_reply }, /* 3GPP */ + { "!SYSTIME?", 3, FALSE, parse_time_reply }, /* CDMA */ { NULL } }; diff --git a/plugins/telit/mm-broadband-modem-telit.c b/plugins/telit/mm-broadband-modem-telit.c index 4178e7d6..dde60a9b 100644 --- a/plugins/telit/mm-broadband-modem-telit.c +++ b/plugins/telit/mm-broadband-modem-telit.c @@ -1184,8 +1184,8 @@ response_processor_service_ignore_at_errors (MMBaseModem *self, } static const MMBaseModemAtCommand access_tech_commands[] = { - { (gchar *) "#PSNT?", 3, FALSE, response_processor_psnt_ignore_at_errors }, - { (gchar *) "+SERVICE?", 3, FALSE, response_processor_service_ignore_at_errors }, + { "#PSNT?", 3, FALSE, response_processor_psnt_ignore_at_errors }, + { "+SERVICE?", 3, FALSE, response_processor_service_ignore_at_errors }, { NULL } }; |