telit: add ME910G1 to models

ME910G1 supports decimal format for 4G bands and has also an empty
tdscdma slot between 4G and 4G extended bands commands/responses.

Change shared code and helpers to deal with these differences.

Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
This commit is contained in:
Daniele Palmas
2026-07-07 10:55:13 -05:00
committed by Dan Williams
parent 846048caa5
commit 3ca0cba220
4 changed files with 248 additions and 22 deletions
+148 -21
View File
@@ -207,6 +207,7 @@ mm_telit_build_bnd_request (GArray *bands_array,
gint flag2g = -1;
gint64 flag3g = -1;
gint64 flag4g = -1;
gint64 flag4gext = -1;
gchar *cmd;
gboolean modem_is_2g = config->modem_is_2g;
gboolean modem_is_3g = config->modem_is_3g;
@@ -291,6 +292,7 @@ mm_telit_build_bnd_request (GArray *bands_array,
/* Get 4G-specific telit band bitmask */
flag4g = (mask4g != 0) ? ((gint64)mask4g) : -1;
flag4gext = (mask4gext != 0) ? ((gint64)mask4gext) : -1;
if (modem_is_2g && flag2g == -1) {
g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_NOT_FOUND,
@@ -303,7 +305,7 @@ mm_telit_build_bnd_request (GArray *bands_array,
return NULL;
}
/* At least one technology must have valid bands */
if (flag2g == -1 && flag3g == -1 && flag4g == -1) {
if (flag2g == -1 && flag3g == -1 && flag4g == -1 && flag4gext == -1) {
g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_NOT_FOUND,
"No valid bands combination in the provided list");
return NULL;
@@ -312,6 +314,8 @@ mm_telit_build_bnd_request (GArray *bands_array,
/* 4g bands could be disabled */
if (modem_is_4g && flag4g == -1)
flag4g = 0;
if (config->modem_ext_4g_bands && flag4gext == -1)
flag4gext = 0;
if (modem_is_2g && !modem_is_3g && !modem_is_4g)
cmd = g_strdup_printf ("#BND=%d", flag2g);
@@ -321,24 +325,72 @@ mm_telit_build_bnd_request (GArray *bands_array,
cmd = g_strdup_printf ("#BND=%d,%" G_GINT64_FORMAT, flag2g, flag3g);
else if (!modem_is_2g && !modem_is_3g && modem_is_4g) {
if (!config->modem_ext_4g_bands)
cmd = g_strdup_printf ("#BND=0,0,%" G_GINT64_FORMAT, flag4g);
if (config->modem_has_hex_format_4g_bands)
cmd = g_strdup_printf ("#BND=0,0,%" G_GINT64_MODIFIER "x", mask4g);
else
cmd = g_strdup_printf ("#BND=0,0,%" G_GINT64_FORMAT, flag4g);
else
cmd = g_strdup_printf ("#BND=0,0,%" G_GINT64_MODIFIER "x" ",%" G_GINT64_MODIFIER "x", mask4g, mask4gext);
if (config->modem_has_tdscdma_bands)
if (config->modem_has_hex_format_4g_bands)
cmd = g_strdup_printf ("#BND=0,0,%" G_GINT64_MODIFIER "x" ",0,%" G_GINT64_MODIFIER "x", mask4g, mask4gext);
else
cmd = g_strdup_printf ("#BND=0,0,%" G_GINT64_FORMAT ",0,%" G_GINT64_FORMAT, flag4g, flag4gext);
else
if (config->modem_has_hex_format_4g_bands)
cmd = g_strdup_printf ("#BND=0,0,%" G_GINT64_MODIFIER "x" ",%" G_GINT64_MODIFIER "x", mask4g, mask4gext);
else
cmd = g_strdup_printf ("#BND=0,0,%" G_GINT64_FORMAT ",%" G_GINT64_FORMAT, flag4g, flag4gext);
} else if (!modem_is_2g && modem_is_3g && modem_is_4g) {
if (!config->modem_ext_4g_bands)
cmd = g_strdup_printf ("#BND=0,%" G_GINT64_FORMAT ",%" G_GINT64_FORMAT, flag3g, flag4g);
if (config->modem_has_hex_format_4g_bands)
cmd = g_strdup_printf ("#BND=0,%" G_GINT64_FORMAT ",%" G_GINT64_MODIFIER "x", flag3g, mask4g);
else
cmd = g_strdup_printf ("#BND=0,%" G_GINT64_FORMAT ",%" G_GINT64_FORMAT, flag3g, flag4g);
else
cmd = g_strdup_printf ("#BND=0,%" G_GINT64_FORMAT ",%" G_GINT64_MODIFIER "x" ",%" G_GINT64_MODIFIER "x", flag3g, mask4g, mask4gext);
if (config->modem_has_tdscdma_bands)
if (config->modem_has_hex_format_4g_bands)
cmd = g_strdup_printf ("#BND=0,%" G_GINT64_FORMAT ",%" G_GINT64_MODIFIER "x" ",0,%" G_GINT64_MODIFIER "x", flag3g, mask4g, mask4gext);
else
cmd = g_strdup_printf ("#BND=0,%" G_GINT64_FORMAT ",%" G_GINT64_FORMAT ",0,%" G_GINT64_FORMAT, flag3g, flag4g, flag4gext);
else
if (config->modem_has_hex_format_4g_bands)
cmd = g_strdup_printf ("#BND=0,%" G_GINT64_FORMAT ",%" G_GINT64_MODIFIER "x" ",%" G_GINT64_MODIFIER "x", flag3g, mask4g, mask4gext);
else
cmd = g_strdup_printf ("#BND=0,%" G_GINT64_FORMAT ",%" G_GINT64_FORMAT ",%" G_GINT64_FORMAT, flag3g, flag4g, flag4gext);
} else if (modem_is_2g && !modem_is_3g && modem_is_4g) {
if (!config->modem_ext_4g_bands)
cmd = g_strdup_printf ("#BND=%d,0,%" G_GINT64_FORMAT, flag2g, flag4g);
if (config->modem_has_hex_format_4g_bands)
cmd = g_strdup_printf ("#BND=%d,0,%" G_GINT64_MODIFIER "x", flag2g, mask4g);
else
cmd = g_strdup_printf ("#BND=%d,0,%" G_GINT64_FORMAT, flag2g, flag4g);
else
cmd = g_strdup_printf ("#BND=%d,0,%" G_GINT64_MODIFIER "x" ",%" G_GINT64_MODIFIER "x", flag2g, mask4g, mask4gext);
if (config->modem_has_tdscdma_bands)
if (config->modem_has_hex_format_4g_bands)
cmd = g_strdup_printf ("#BND=%d,0,%" G_GINT64_MODIFIER "x" ",0,%" G_GINT64_MODIFIER "x", flag2g, mask4g, mask4gext);
else
cmd = g_strdup_printf ("#BND=%d,0,%" G_GINT64_FORMAT ",0,%" G_GINT64_FORMAT, flag2g, flag4g, flag4gext);
else
if (config->modem_has_hex_format_4g_bands)
cmd = g_strdup_printf ("#BND=%d,0,%" G_GINT64_MODIFIER "x" ",%" G_GINT64_MODIFIER "x", flag2g, mask4g, mask4gext);
else
cmd = g_strdup_printf ("#BND=%d,0,%" G_GINT64_FORMAT ",%" G_GINT64_FORMAT, flag2g, flag4g, flag4gext);
} else if (modem_is_2g && modem_is_3g && modem_is_4g) {
if (!config->modem_ext_4g_bands)
cmd = g_strdup_printf ("#BND=%d,%" G_GINT64_FORMAT ",%" G_GINT64_FORMAT, flag2g, flag3g, flag4g);
if (config->modem_has_hex_format_4g_bands)
cmd = g_strdup_printf ("#BND=%d,%" G_GINT64_FORMAT ",%" G_GINT64_MODIFIER "x", flag2g, flag3g, mask4g);
else
cmd = g_strdup_printf ("#BND=%d,%" G_GINT64_FORMAT ",%" G_GINT64_FORMAT, flag2g, flag3g, flag4g);
else
cmd = g_strdup_printf ("#BND=%d,%" G_GINT64_FORMAT ",%" G_GINT64_MODIFIER "x" ",%" G_GINT64_MODIFIER "x", flag2g, flag3g, mask4g, mask4gext);
if (config->modem_has_tdscdma_bands)
if (config->modem_has_hex_format_4g_bands)
cmd = g_strdup_printf ("#BND=%d,%" G_GINT64_FORMAT ",%" G_GINT64_MODIFIER "x" ",0,%" G_GINT64_MODIFIER "x", flag2g, flag3g, mask4g, mask4gext);
else
cmd = g_strdup_printf ("#BND=%d,%" G_GINT64_FORMAT ",%" G_GINT64_FORMAT ",0,%" G_GINT64_FORMAT, flag2g, flag3g, flag4g, flag4gext);
else
if (config->modem_has_hex_format_4g_bands)
cmd = g_strdup_printf ("#BND=%d,%" G_GINT64_FORMAT ",%" G_GINT64_MODIFIER "x" ",%" G_GINT64_MODIFIER "x", flag2g, flag3g, mask4g, mask4gext);
else
cmd = g_strdup_printf ("#BND=%d,%" G_GINT64_FORMAT ",%" G_GINT64_FORMAT ",%" G_GINT64_FORMAT, flag2g, flag3g, flag4g, flag4gext);
} else
g_assert_not_reached ();
@@ -438,6 +490,46 @@ mm_telit_build_bnd_request (GArray *bands_array,
* AT#BND?
* #BND: 0,18,87A03B0F38DF,42
*
* ----------------
*
* Modems like ME910G1 and ME910M1 have yet another #BND configuration/response:
*
* AT#BND=<GSM_band>[,<UMTS_band>[,<LTE_band>[,<TDSCDMA_band>[,<LTE_band_ext>]]]]
*
* <LTE_band>: decimal: Indicates the LTE supported bands expressed as the sum of Band number (1+2+8 ...) calculated as shown in the table (mask of 32 bits):
*
* Band number(Decimal) Band i
* 0 disable
* 1 B1
* 2 B2
* 4 B3
* 8 B4
* ...
* 2147483648 B32
*
* It can take value, 0 - 4294967295: range of the sum of Band number (1+2+4 ...)
*
* <TDSCDMA_band>: used just for backward compatibility with older models, it is always 0
*
* <LTE_band_ext>: decimal: Indicates the LTE supported bands from B65 expressed as the sum of Band number (1+2+8 ...) calculated as shown in the table (mask of 32 bits):
*
* Band number(Decimal) Band i
* 0 disable
* 1 B65
* 2 B66
* ...
* (2exp(i-64-1)) B(i)
*
* It can take value, 0 - 4294967295: range of the sum of Band number (1+2+4 ...)
*
* Example output:
*
* AT#BND=?
* #BND: (0-5),(0),(1-252582047),(0),(0,2-1048578)
*
* AT#BND?
* #BND: 0,0,252582047,0,1048578
*
*/
static gboolean
@@ -614,22 +706,36 @@ telit_get_ext_4g_mm_bands (GMatchInfo *match_info,
GArray **bands,
GError **error)
{
GError *inner_error = NULL;
MMModemBand band;
gchar *match_str = NULL;
gchar *match_str_ext_hex = NULL;
guint64 value;
GError *inner_error = NULL;
MMModemBand band;
gchar *match_str = NULL;
gchar *match_str_ext_hex = NULL;
guint64 value;
g_auto(GStrv) tokens = NULL;
gboolean hex_format = FALSE;
gboolean ok;
match_str = g_match_info_fetch_named (match_info, "Bands4GHex");
match_str = g_match_info_fetch_named (match_info, "Bands4GDec");
if (!match_str) {
match_str = g_match_info_fetch_named (match_info, "Bands4GHex");
hex_format = match_str != NULL;
}
if (!match_str || match_str[0] == '\0') {
g_set_error (&inner_error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED,
"Could not find 4G band hex mask flag from response");
"Could not find 4G band mask flag from response");
goto out;
}
if (!mm_get_u64_from_hex_str (match_str, &value)) {
/* splitting will never return NULL as string is not empty */
tokens = g_strsplit (match_str, "-", -1);
/* If this is a range, get upper threshold, which contains the total supported mask */
ok = hex_format ?
mm_get_u64_from_hex_str (tokens[1] ? tokens[1] : tokens[0], &value) :
mm_get_u64_from_str (tokens[1] ? tokens[1] : tokens[0], &value);
if (!ok) {
g_set_error (&inner_error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED,
"Could not parse 4G band hex mask from string: '%s'", match_str);
"Could not parse 4G band mask from string: '%s'", match_str);
goto out;
}
@@ -639,10 +745,20 @@ telit_get_ext_4g_mm_bands (GMatchInfo *match_info,
}
/* extended bands */
match_str_ext_hex = g_match_info_fetch_named (match_info, "Bands4GExtHex");
match_str_ext_hex = g_match_info_fetch_named (match_info, "Bands4GExtDec");
if (!match_str_ext_hex)
match_str_ext_hex = g_match_info_fetch_named (match_info, "Bands4GExtHex");
if (match_str_ext_hex) {
g_auto(GStrv) tokens_ext = NULL;
if (!mm_get_u64_from_hex_str (match_str_ext_hex, &value)) {
/* splitting will never return NULL as string is not empty */
tokens_ext = g_strsplit (match_str_ext_hex, "-", -1);
/* hex_format is the same for both 4G and ext 4G (same regex) */
ok = hex_format ?
mm_get_u64_from_hex_str (tokens_ext[1] ? tokens_ext[1] : tokens_ext[0], &value) :
mm_get_u64_from_str (tokens_ext[1] ? tokens_ext[1] : tokens_ext[0], &value);
if (!ok) {
g_set_error (&inner_error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED,
"Could not parse 4G ext band mask from string: '%s'", match_str_ext_hex);
goto out;
@@ -676,11 +792,15 @@ typedef enum {
#define MM_SUPPORTED_BANDS_4G_HEX "(,\\s*\\((?P<Bands4GHex>[0-9A-F\\-,]*)\\))?"
#define MM_SUPPORTED_BANDS_4G_DEC "(,\\s*\\((?P<Bands4GDec>[0-9\\-,]*)\\))?"
#define MM_SUPPORTED_BANDS_4G_EXT_HEX "(,\\s*\\((?P<Bands4GHex>[0-9A-F]+)\\))?(,\\s*\\((?P<Bands4GExtHex>[0-9A-F]+)\\))?"
#define MM_SUPPORTED_BANDS_TDSCDMA "(,\\s*\\((?P<BandsTDSCDMA>[0-9\\-,]*)\\))?"
#define MM_SUPPORTED_BANDS_4G_EXT_DEC "(,\\s*\\((?P<Bands4GExtDec>[0-9\\-,]*)\\))?"
#define MM_CURRENT_BANDS_2G "\\s*(?P<Bands2G>\\d+)"
#define MM_CURRENT_BANDS_3G "(,\\s*(?P<Bands3G>\\d+))?"
#define MM_CURRENT_BANDS_4G_HEX "(,\\s*(?P<Bands4GHex>[0-9A-F]+))?"
#define MM_CURRENT_BANDS_4G_DEC "(,\\s*(?P<Bands4GDec>\\d+))?"
#define MM_CURRENT_BANDS_4G_EXT_HEX "(,\\s*(?P<Bands4GHex>[0-9A-F]+))?(,\\s*(?P<Bands4GExtHex>[0-9A-F]+))?"
#define MM_CURRENT_BANDS_TDSCDMA "(,\\s*(?P<BandsTDSCDMA>\\d+))?"
#define MM_CURRENT_BANDS_4G_EXT_DEC "(,\\s*(?P<Bands4GExtDec>\\d+))?"
static GArray *
common_parse_bnd_response (const gchar *response,
@@ -708,9 +828,15 @@ common_parse_bnd_response (const gchar *response,
[LOAD_BANDS_TYPE_SUPPORTED] = "#BND:"MM_SUPPORTED_BANDS_2G MM_SUPPORTED_BANDS_3G MM_SUPPORTED_BANDS_4G_EXT_HEX,
[LOAD_BANDS_TYPE_CURRENT] = "#BND:"MM_CURRENT_BANDS_2G MM_CURRENT_BANDS_3G MM_CURRENT_BANDS_4G_EXT_HEX,
};
static const gchar *load_bands_regex_tdscdma_4g_ext_dec[] = {
[LOAD_BANDS_TYPE_SUPPORTED] = "#BND:"MM_SUPPORTED_BANDS_2G MM_SUPPORTED_BANDS_3G MM_SUPPORTED_BANDS_4G_DEC MM_SUPPORTED_BANDS_TDSCDMA MM_SUPPORTED_BANDS_4G_EXT_DEC,
[LOAD_BANDS_TYPE_CURRENT] = "#BND:"MM_CURRENT_BANDS_2G MM_CURRENT_BANDS_3G MM_CURRENT_BANDS_4G_DEC MM_CURRENT_BANDS_TDSCDMA MM_CURRENT_BANDS_4G_EXT_DEC,
};
if (config->modem_ext_4g_bands)
if (config->modem_ext_4g_bands && config->modem_has_hex_format_4g_bands)
load_bands_regex = load_bands_regex_4g_ext_hex[load_type];
else if (config->modem_ext_4g_bands && config->modem_has_tdscdma_bands)
load_bands_regex = load_bands_regex_tdscdma_4g_ext_dec[load_type];
else if (config->modem_has_hex_format_4g_bands)
load_bands_regex = load_bands_regex_4g_hex[load_type];
else
@@ -923,6 +1049,7 @@ mm_telit_model_from_revision (const gchar *revision)
{"24.01", MM_TELIT_MODEL_LM940},
{"25.", MM_TELIT_MODEL_LE910C1},
{"32.", MM_TELIT_MODEL_LM960},
{"37.", MM_TELIT_MODEL_ME910G1},
{"38.", MM_TELIT_MODEL_FN980},
{"40.", MM_TELIT_MODEL_LN920},
{"45.00", MM_TELIT_MODEL_FN990},
@@ -27,6 +27,7 @@ typedef enum {
MM_TELIT_MODEL_LM960,
MM_TELIT_MODEL_LN920,
MM_TELIT_MODEL_FN990,
MM_TELIT_MODEL_ME910G1,
} MMTelitModel;
typedef struct {
@@ -36,6 +37,7 @@ typedef struct {
gboolean modem_alternate_3g_bands;
gboolean modem_has_hex_format_4g_bands;
gboolean modem_ext_4g_bands;
gboolean modem_has_tdscdma_bands;
} MMTelitBNDParseConfig;
typedef enum {
+15 -1
View File
@@ -45,6 +45,7 @@ typedef struct {
MMIfaceModemInterface *iface_modem_parent;
gboolean alternate_3g_bands;
gboolean ext_4g_bands;
gboolean tdscdma_bands;
GArray *supported_bands;
GArray *supported_modes;
gchar *software_package_version;
@@ -100,7 +101,18 @@ has_extended_4g_bands (const gchar *revision)
return (model == MM_TELIT_MODEL_FN980 ||
model == MM_TELIT_MODEL_FN990 ||
model == MM_TELIT_MODEL_LM960 ||
model == MM_TELIT_MODEL_LN920);
model == MM_TELIT_MODEL_LN920 ||
model == MM_TELIT_MODEL_ME910G1);
}
static gboolean
has_tdscdma_bands (const gchar *revision)
{
MMTelitModel model;
model = mm_telit_model_from_revision (revision);
return (model == MM_TELIT_MODEL_ME910G1);
}
static Private *
@@ -145,6 +157,7 @@ mm_shared_telit_store_revision (MMSharedTelit *self,
priv->software_package_version = g_strdup (revision);
priv->alternate_3g_bands = has_alternate_3g_bands (revision);
priv->ext_4g_bands = has_extended_4g_bands (revision);
priv->tdscdma_bands = has_tdscdma_bands (revision);
}
void
@@ -160,6 +173,7 @@ mm_shared_telit_get_bnd_parse_config (MMIfaceModem *self, MMTelitBNDParseConfig
config->modem_alternate_3g_bands = priv->alternate_3g_bands;
config->modem_has_hex_format_4g_bands = is_bnd_4g_format_hex (priv->software_package_version);
config->modem_ext_4g_bands = priv->ext_4g_bands;
config->modem_has_tdscdma_bands = priv->tdscdma_bands;
}
/*****************************************************************************/
@@ -183,6 +183,27 @@ static BndResponseTest supported_band_mapping_tests [] = {
MM_MODEM_BAND_EUTRAN_8,
MM_MODEM_BAND_EUTRAN_20,
MM_MODEM_BAND_EUTRAN_28 }
},
/* ME910G1, decimal 4G ext band settings with TDSCDMA field */
{
"#BND: (0),(0),(1-252582047),(0),(0,2-1048578)", {FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, TRUE}, 17,
{ MM_MODEM_BAND_EUTRAN_1,
MM_MODEM_BAND_EUTRAN_2,
MM_MODEM_BAND_EUTRAN_3,
MM_MODEM_BAND_EUTRAN_4,
MM_MODEM_BAND_EUTRAN_5,
MM_MODEM_BAND_EUTRAN_8,
MM_MODEM_BAND_EUTRAN_12,
MM_MODEM_BAND_EUTRAN_13,
MM_MODEM_BAND_EUTRAN_18,
MM_MODEM_BAND_EUTRAN_19,
MM_MODEM_BAND_EUTRAN_20,
MM_MODEM_BAND_EUTRAN_25,
MM_MODEM_BAND_EUTRAN_26,
MM_MODEM_BAND_EUTRAN_27,
MM_MODEM_BAND_EUTRAN_28,
MM_MODEM_BAND_EUTRAN_66,
MM_MODEM_BAND_EUTRAN_85 }
}
};
@@ -306,6 +327,27 @@ static BndResponseTest current_band_mapping_tests [] = {
MM_MODEM_BAND_EUTRAN_41,
MM_MODEM_BAND_EUTRAN_66,
MM_MODEM_BAND_EUTRAN_71 }
},
/* ME910G1, decimal 4G ext band settings with TDSCDMA field */
{
"#BND: 0,0,252582047,0,1048578", {FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, TRUE}, 17,
{ MM_MODEM_BAND_EUTRAN_1,
MM_MODEM_BAND_EUTRAN_2,
MM_MODEM_BAND_EUTRAN_3,
MM_MODEM_BAND_EUTRAN_4,
MM_MODEM_BAND_EUTRAN_5,
MM_MODEM_BAND_EUTRAN_8,
MM_MODEM_BAND_EUTRAN_12,
MM_MODEM_BAND_EUTRAN_13,
MM_MODEM_BAND_EUTRAN_18,
MM_MODEM_BAND_EUTRAN_19,
MM_MODEM_BAND_EUTRAN_20,
MM_MODEM_BAND_EUTRAN_25,
MM_MODEM_BAND_EUTRAN_26,
MM_MODEM_BAND_EUTRAN_27,
MM_MODEM_BAND_EUTRAN_28,
MM_MODEM_BAND_EUTRAN_66,
MM_MODEM_BAND_EUTRAN_85 }
}
};
@@ -651,6 +693,46 @@ static void test_telit_bnd_cmd_multitech(void)
g_array_unref(bands_array);
}
static void
test_telit_bnd_cmd_me910g1_2g_4gext(void)
{
GArray *bands_array = g_array_new(FALSE, FALSE, sizeof(MMModemBand));
GError *error = NULL;
gchar *cmd;
MMTelitBNDParseConfig config = {
.modem_is_2g = TRUE,
.modem_is_3g = FALSE,
.modem_is_4g = TRUE,
.modem_alternate_3g_bands = FALSE,
.modem_ext_4g_bands = TRUE,
.modem_has_tdscdma_bands = TRUE
};
MMModemBand dcs = MM_MODEM_BAND_DCS;
MMModemBand g850 = MM_MODEM_BAND_G850;
MMModemBand eutran_66 = MM_MODEM_BAND_EUTRAN_66;
MMModemBand eutran_85 = MM_MODEM_BAND_EUTRAN_85;
g_array_append_val(bands_array, dcs);
g_array_append_val(bands_array, g850);
g_array_append_val(bands_array, eutran_66);
g_array_append_val(bands_array, eutran_85);
cmd = mm_telit_build_bnd_request(bands_array, &config, &error);
g_assert_no_error(error);
g_assert_cmpstr(cmd, ==, "#BND=2,0,0,0,1048578");
g_free(cmd);
g_array_unref(bands_array);
bands_array = g_array_new(FALSE, FALSE, sizeof(MMModemBand));
g_array_append_val(bands_array, dcs);
g_array_append_val(bands_array, g850);
cmd = mm_telit_build_bnd_request(bands_array, &config, &error);
g_assert_no_error(error);
g_assert_cmpstr(cmd, ==, "#BND=2,0,0,0,0");
g_free(cmd);
g_array_unref(bands_array);
}
/******************************************************************************/
typedef struct {
@@ -761,6 +843,7 @@ int main (int argc, char **argv){
g_test_add_func ("/MM/telit/bands/current/set_bands/3g", test_telit_get_3g_bnd_flag);
g_test_add_func ("/MM/telit/bands/current/set_bands/4g", test_telit_get_4g_bnd_flag);
g_test_add_func ("/MM/telit/bands/current/set_bands/multitech", test_telit_bnd_cmd_multitech);
g_test_add_func ("/MM/telit/bands/current/set_bands/me910g1_2g_4gext", test_telit_bnd_cmd_me910g1_2g_4gext);
g_test_add_func ("/MM/telit/qss/query", test_telit_parse_qss_query);
g_test_add_func ("/MM/telit/swpkv/parse_response", test_telit_parse_swpkgv_response);
g_test_add_func ("/MM/telit/revision/compare", test_telit_compare_software_revision_string);