[PATCH] [Telit Plugin] Add load_supported_bands for some Telit modem models

Carlo Lobrano c.lobrano at gmail.com
Wed Jan 13 02:55:08 PST 2016


From: Carlo Lobrano <Carlo.Lobrano at telit.com>

Supported models:
- HE910 EU*
- HE910 NA*
- LE910 EU V2
- LE910 NA V2
- LE910 SV V2
---
 plugins/telit/77-mm-telit-port-types.rules        |   4 +
 plugins/telit/mm-broadband-modem-telit.c          |  59 +++++++
 plugins/telit/mm-modem-helpers-telit.c            | 129 +++++++++++++++-
 plugins/telit/mm-modem-helpers-telit.h            |  57 +++++++
 plugins/telit/tests/test-mm-modem-helpers-telit.c | 178 +++++++++++++++++++++-
 5 files changed, 423 insertions(+), 4 deletions(-)

diff --git a/plugins/telit/77-mm-telit-port-types.rules b/plugins/telit/77-mm-telit-port-types.rules
index 1efb0e1..b7aa70e 100644
--- a/plugins/telit/77-mm-telit-port-types.rules
+++ b/plugins/telit/77-mm-telit-port-types.rules
@@ -44,6 +44,10 @@ ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="1011", ENV{ID_MM_TELIT_TAGGED}="1"
 # HE910, UE910, UL865 (dynamic port identification supported)
 ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0021", ENV{ID_MM_TELIT_TAGGED}="1", ENV{ID_MM_TELIT_PORTS_TAGGED}="1"
 
+# LE910 V2
+ATTRS{idVendor}=="1bc7", ATTRS{idProduct}=="0036", ENV{ID_MM_TELIT_TAGGED}="1", ENV{ID_MM_TELIT_PORTS_TAGGED}="1"
+
+
 # NOTE: Qualcomm Gobi-based devices like the LE920 should not be handled
 # by this plugin, but by the Gobi plugin.
 
diff --git a/plugins/telit/mm-broadband-modem-telit.c b/plugins/telit/mm-broadband-modem-telit.c
index b4f481b..628d22a 100644
--- a/plugins/telit/mm-broadband-modem-telit.c
+++ b/plugins/telit/mm-broadband-modem-telit.c
@@ -41,6 +41,63 @@ G_DEFINE_TYPE_EXTENDED (MMBroadbandModemTelit, mm_broadband_modem_telit, MM_TYPE
                         G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM_3GPP, iface_modem_3gpp_init));
 
 /*****************************************************************************/
+/* Load supported bands (Modem interface) */
+
+
+static GArray *
+modem_load_supported_bands_finish (MMIfaceModem *self,
+                                   GAsyncResult *res,
+                                   GError **error)
+{
+    if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error))
+        return NULL;
+
+    return (GArray *) g_array_ref (g_simple_async_result_get_op_res_gpointer (
+                                       G_SIMPLE_ASYNC_RESULT (res)));
+}
+
+static void
+modem_load_supported_bands (MMIfaceModem *self,
+                            GAsyncReadyCallback callback,
+                            gpointer user_data)
+{
+    GSimpleAsyncResult *result;
+    GArray *bands = NULL;
+    guint product_id;
+    TelitModel model_code;
+
+    const gchar* model_str = mm_iface_modem_get_model(self);
+    product_id = mm_base_modem_get_product_id (MM_BASE_MODEM (self));
+
+    model_code = mm_telit_get_model (product_id, model_str);
+
+    result = g_simple_async_result_new (G_OBJECT (self),
+                                        callback,
+                                        user_data,
+                                        modem_load_supported_bands);
+
+
+    if (!mm_telit_get_model_supported_bands(model_code, &bands)) {
+        g_simple_async_result_set_error (result,
+                                         MM_CORE_ERROR,
+                                         MM_CORE_ERROR_FAILED,
+                                         "Could not find supported bands for Telit Modem '%s' (PID 0x%04X)",
+                                         model_str? model_str:"unknown",
+                                         product_id);
+        g_simple_async_result_complete_in_idle (result);
+        g_object_unref (result);
+        return;
+    }
+
+    g_simple_async_result_set_op_res_gpointer (result,
+                                               bands,
+                                               (GDestroyNotify)g_array_unref);
+    g_simple_async_result_complete_in_idle (result);
+    g_object_unref (result);
+}
+
+
+/*****************************************************************************/
 /* Load unlock retries (Modem interface) */
 
 #define CSIM_QUERY_PIN_RETRIES_STR  "+CSIM=10,0020000100"
@@ -517,6 +574,8 @@ mm_broadband_modem_telit_init (MMBroadbandModemTelit *self)
 static void
 iface_modem_init (MMIfaceModem *iface)
 {
+    iface->load_supported_bands = modem_load_supported_bands;
+    iface->load_supported_bands_finish = modem_load_supported_bands_finish;
     iface->load_unlock_retries_finish = modem_load_unlock_retries_finish;
     iface->load_unlock_retries = modem_load_unlock_retries;
     iface->reset = modem_reset;
diff --git a/plugins/telit/mm-modem-helpers-telit.c b/plugins/telit/mm-modem-helpers-telit.c
index 5344600..1a29602 100644
--- a/plugins/telit/mm-modem-helpers-telit.c
+++ b/plugins/telit/mm-modem-helpers-telit.c
@@ -26,6 +26,7 @@
 #include "mm-modem-helpers.h"
 #include "mm-modem-helpers-telit.h"
 
+
 /*****************************************************************************/
 /* +CSIM response parser */
 
@@ -36,7 +37,7 @@ mm_telit_parse_csim_response (const guint step,
 {
     GRegex *r = NULL;
     GMatchInfo *match_info = NULL;
-    gchar* retries_hex_str;
+    gchar *retries_hex_str;
     guint retries;
 
     r = g_regex_new ("\\+CSIM:\\s*[0-9]+,\\s*.*63C(.*)\"", G_REGEX_RAW, 0, NULL);
@@ -76,3 +77,129 @@ mm_telit_parse_csim_response (const guint step,
 
     return retries;
 }
+
+static const TelitModelItem telit_model_items[] = {
+    {TELIT_MODEL_HE910_EU,    2, {0x0021, 0x0023}, HE910_EU_NAME_REGEX },
+    {TELIT_MODEL_HE910_NA,    2, {0x0021, 0x0023}, HE910_NA_NAME_REGEX },
+    {TELIT_MODEL_LE910_EU_V2, 1, {0x0036}, LE910_EU_V2_NAME_REGEX},
+    {TELIT_MODEL_LE910_NA_V2, 1, {0x0036}, LE910_NA_V2_NAME_REGEX},
+    {TELIT_MODEL_LE910_SV_V2, 1, {0x0036}, LE910_SV_V2_NAME_REGEX},
+    {TELIT_MODEL_UNKWNOWN,    0, {}, NULL},
+};
+
+TelitModel
+mm_telit_get_model (const guint product_id, const gchar *model_name)
+{
+    guint i, j;
+    gboolean got_match = FALSE;
+
+    for (i = 0; telit_model_items[i].model != TELIT_MODEL_UNKWNOWN; i++) {
+        for (j = 0; j < telit_model_items[i].product_ids_len; j++) {
+            if (product_id == telit_model_items[i].product_ids[j]) {
+                if (!telit_model_items[i].name_regex) {
+                    got_match = TRUE;
+                } else {
+                    GRegex *r = g_regex_new (telit_model_items[i].name_regex, G_REGEX_RAW, 0, NULL);
+                    GMatchInfo *match_info = NULL;
+
+                    got_match = g_regex_match(r, model_name, 0, &match_info);
+
+                    g_regex_unref(r);
+                    g_match_info_free(match_info);
+                }
+
+                if (got_match)
+                    return telit_model_items[i].model;
+            }
+         }
+    }
+
+    return TELIT_MODEL_UNKWNOWN;
+}
+
+static const TelitToMMModemBand telit_to_mm_modem_bands [] = {
+    /* HE910 EUD/EUG/EUR share the same frequencies */
+    {TELIT_MODEL_HE910_EU, 8, {
+                               MM_MODEM_BAND_EGSM,
+                               MM_MODEM_BAND_DCS,
+                               MM_MODEM_BAND_PCS,
+                               MM_MODEM_BAND_G850,
+                               MM_MODEM_BAND_U800,
+                               MM_MODEM_BAND_U850,
+                               MM_MODEM_BAND_U900,
+                               MM_MODEM_BAND_U2100,
+                              }
+    },
+    /* HE910 NAR/NAG/NAD share the same frequencies */
+    {TELIT_MODEL_HE910_NA, 8, {
+                               MM_MODEM_BAND_EGSM,
+                               MM_MODEM_BAND_DCS,
+                               MM_MODEM_BAND_PCS,
+                               MM_MODEM_BAND_G850,
+                               MM_MODEM_BAND_U800,
+                               MM_MODEM_BAND_U850,
+                               MM_MODEM_BAND_U900,
+                               MM_MODEM_BAND_U17IV
+                              }
+    },
+    {TELIT_MODEL_LE910_EU_V2, 10, {
+                                   MM_MODEM_BAND_EGSM,
+                                   MM_MODEM_BAND_DCS,
+                                   MM_MODEM_BAND_U2100,
+                                   MM_MODEM_BAND_U1800,
+                                   MM_MODEM_BAND_U900,
+                                   MM_MODEM_BAND_EUTRAN_I,
+                                   MM_MODEM_BAND_EUTRAN_III,
+                                   MM_MODEM_BAND_EUTRAN_VII,
+                                   MM_MODEM_BAND_EUTRAN_VIII,
+                                   MM_MODEM_BAND_EUTRAN_XX
+                                  }
+    },
+    {TELIT_MODEL_LE910_NA_V2, 11, {
+                                    MM_MODEM_BAND_G850,
+                                    MM_MODEM_BAND_PCS,
+                                    MM_MODEM_BAND_U850,
+                                    MM_MODEM_BAND_U1900,
+                                    MM_MODEM_BAND_U17IV,
+                                    MM_MODEM_BAND_EUTRAN_II,
+                                    MM_MODEM_BAND_EUTRAN_IV,
+                                    MM_MODEM_BAND_EUTRAN_V,
+                                    MM_MODEM_BAND_EUTRAN_XII,
+                                    MM_MODEM_BAND_EUTRAN_XIII,
+                                    MM_MODEM_BAND_EUTRAN_XVII,
+                                  }
+    },
+    {TELIT_MODEL_LE910_SV_V2, 6, {
+                                   MM_MODEM_BAND_EUTRAN_II,
+                                   MM_MODEM_BAND_EUTRAN_IV,
+                                   MM_MODEM_BAND_EUTRAN_V,
+                                   MM_MODEM_BAND_EUTRAN_XII,
+                                   MM_MODEM_BAND_EUTRAN_XIII,
+                                   MM_MODEM_BAND_EUTRAN_XVII,
+                                 }
+    },
+    {TELIT_MODEL_UNKWNOWN, 0, {}},
+};
+
+gboolean
+mm_telit_get_model_supported_bands(const TelitModel model, GArray **bands)
+{
+    guint i, j;
+
+    for (i = 0; (telit_to_mm_modem_bands[i].model != TELIT_MODEL_UNKWNOWN); i++) {
+        if (telit_to_mm_modem_bands[i].model == model) {
+            guint bands_len = telit_to_mm_modem_bands[i].mm_bands_len;
+
+            if (*bands == NULL)
+                *bands = g_array_sized_new (FALSE, FALSE, sizeof (MMModemBand), bands_len);
+
+            for (j = 0; j < bands_len; j++) {
+                g_array_append_val(*bands, telit_to_mm_modem_bands[i].mm_bands[j]);
+            }
+
+            return TRUE;
+        }
+    }
+
+    return FALSE;
+}
diff --git a/plugins/telit/mm-modem-helpers-telit.h b/plugins/telit/mm-modem-helpers-telit.h
index 112e04b..0312764 100644
--- a/plugins/telit/mm-modem-helpers-telit.h
+++ b/plugins/telit/mm-modem-helpers-telit.h
@@ -18,9 +18,66 @@
 
 #include <glib.h>
 
+#define MAX_BANDS_LIST_LEN 20
+
+#define FLAG_BAND_UNKNOWN    -1
+#define FLAG_GSM900_DCS1800  0
+#define FLAG_GSM900_PCS1900  1
+#define FLAG_GSM850_DCS1800  2
+#define FLAG_GSM850_PCS1900  3
+
+#define FLAG_FDD_I               0  /* 1900/2100 MHz */
+#define FLAG_FDD_II              1  /* 1900 MHz */
+#define FLAG_FDD_V               2  /* 850 MHz */
+#define FLAG_FDD_I_FDD_II_FDD_V  3  /* 2100 MHz + 1900 MHz + 850 MHz */
+#define FLAG_FDD_II_FDD_V        4  /* 1900 MHz + 850 MHz */
+#define FLAG_FDD_VIII            5  /* 900 MHz  */
+#define FLAG_FDD_I_FDD_VIII      6  /* 2100 MHz + 900 MHz */
+#define FLAG_FDD_IV_AWS          7  /* 1700/2100 MHz */
+
+#define MAX_MODEL_IDS 8
+
+#define HE910_EU_NAME_REGEX "^(?=.*HE910)(?=.*EU)(?!.*V2).*$"
+#define HE910_NA_NAME_REGEX "^(?=.*HE910)(?=.*NA)(?!.*V2).*$"
+#define LE910_EU_V2_NAME_REGEX "^(?=.*LE910)(?=.*EU)(?=.*V2).*$"
+#define LE910_NA_V2_NAME_REGEX "^(?=.*LE910)(?=.*NA)(?=.*V2).*$"
+#define LE910_SV_V2_NAME_REGEX "^(?=.*LE910)(?=.*SV)(?=.*V2).*$"
+
+typedef enum {
+    TELIT_MODEL_UNKWNOWN,
+    TELIT_MODEL_HE910_EU,
+    TELIT_MODEL_HE910_NA,
+    TELIT_MODEL_LE910_EU_V2,
+    TELIT_MODEL_LE910_NA_V2,
+    TELIT_MODEL_LE910_SV_V2,
+} TelitModel;
+
+typedef struct {
+    TelitModel model;
+    guint mm_bands_len;
+    MMModemBand mm_bands[MAX_BANDS_LIST_LEN];
+} TelitToMMModemBand;
+
+typedef struct {
+    TelitModel model;
+    guint product_ids_len;
+    guint product_ids [MAX_MODEL_IDS];
+    gchar* name_regex;
+} TelitModelItem;
+
+
+typedef struct {
+    gint flag;
+    guint mm_bands_len;
+    MMModemBand mm_bands[MAX_BANDS_LIST_LEN];
+} TelitToMMBandMap;
+
 /* +CSIM response parser */
 gint mm_telit_parse_csim_response (const guint step,
                                    const gchar *response,
                                    GError **error);
 
+TelitModel mm_telit_get_model (const guint product_id, const gchar *model_name);
+
+gboolean mm_telit_get_model_supported_bands(const TelitModel model, GArray **bands);
 #endif  /* MM_MODEM_HELPERS_TELIT_H */
diff --git a/plugins/telit/tests/test-mm-modem-helpers-telit.c b/plugins/telit/tests/test-mm-modem-helpers-telit.c
index afe9f82..22b98b9 100644
--- a/plugins/telit/tests/test-mm-modem-helpers-telit.c
+++ b/plugins/telit/tests/test-mm-modem-helpers-telit.c
@@ -22,7 +22,6 @@
 #define _LIBMM_INSIDE_MM
 #include <libmm-glib.h>
 
-#include "mm-log.h"
 #include "mm-modem-helpers.h"
 #include "mm-modem-helpers-telit.h"
 
@@ -63,7 +62,7 @@ static CSIMResponseTest invalid_csim_response_test_list [] = {
 };
 
 static void
-test_parse_csim_response (void)
+test_mm_telit_parse_csim_response (void)
 {
     const gint step = 1;
     guint i;
@@ -92,6 +91,177 @@ test_parse_csim_response (void)
     }
 }
 
+static void
+test_mm_telit_get_model(void)
+{
+    guint he910_pid1 = 0x0021;
+    guint he910_pid2 = 0x0023;
+    guint le910_pid = 0x0036;
+
+    g_assert_true (TELIT_MODEL_HE910_EU == mm_telit_get_model(he910_pid1, "HE910 EU"));
+    g_assert_true (TELIT_MODEL_HE910_EU == mm_telit_get_model(he910_pid2, "HE910_EU"));
+    g_assert_false (TELIT_MODEL_HE910_EU == mm_telit_get_model(he910_pid2, "HE910 EU V2"));
+    g_assert_false (TELIT_MODEL_HE910_EU == mm_telit_get_model(he910_pid2, "HE910 V2 EU"));
+
+    g_assert_true (TELIT_MODEL_HE910_NA == mm_telit_get_model(he910_pid1, "HE910 NA"));
+    g_assert_true (TELIT_MODEL_HE910_NA == mm_telit_get_model(he910_pid2, "HE910_NA"));
+    g_assert_false (TELIT_MODEL_HE910_NA == mm_telit_get_model(he910_pid2, "HE910 NA V2"));
+    g_assert_false (TELIT_MODEL_HE910_NA == mm_telit_get_model(he910_pid2, "HE910 V2 NA"));
+
+    /* LE910 EU V2 positive tests */
+    g_assert_true (TELIT_MODEL_LE910_EU_V2 == mm_telit_get_model(le910_pid, "LE910 EU V2"));
+    g_assert_true (TELIT_MODEL_LE910_EU_V2 == mm_telit_get_model(le910_pid, "LE910 V2 EU"));
+    g_assert_true (TELIT_MODEL_LE910_EU_V2 == mm_telit_get_model(le910_pid, "LE910-EU-V2"));
+    g_assert_true (TELIT_MODEL_LE910_EU_V2 == mm_telit_get_model(le910_pid, "LE910_EU_V2"));
+    /* LE910 EU V2 negative tests */
+    g_assert_false (TELIT_MODEL_LE910_EU_V2 == mm_telit_get_model(le910_pid, "LE910 V2"));
+    g_assert_false (TELIT_MODEL_LE910_EU_V2 == mm_telit_get_model(le910_pid, "LE910 EU"));
+    g_assert_false (TELIT_MODEL_LE910_EU_V2 == mm_telit_get_model(le910_pid, "LE910 NA V2"));
+
+
+    /* LE910 NA V2 positive tests */
+    g_assert_true (TELIT_MODEL_LE910_NA_V2 == mm_telit_get_model(le910_pid, "LE910 NA V2"));
+    g_assert_true (TELIT_MODEL_LE910_NA_V2 == mm_telit_get_model(le910_pid, "LE910 V2 NA"));
+    g_assert_true (TELIT_MODEL_LE910_NA_V2 == mm_telit_get_model(le910_pid, "LE910-NA-V2"));
+    g_assert_true (TELIT_MODEL_LE910_NA_V2 == mm_telit_get_model(le910_pid, "LE910_NA_V2"));
+    /* LE910 NA V2 negative tests */
+    g_assert_false (TELIT_MODEL_LE910_NA_V2 == mm_telit_get_model(le910_pid, "LE910 V2"));
+    g_assert_false (TELIT_MODEL_LE910_NA_V2 == mm_telit_get_model(le910_pid, "LE910 NA"));
+    g_assert_false (TELIT_MODEL_LE910_NA_V2 == mm_telit_get_model(le910_pid, "LE910 EU V2"));
+
+
+    /* LE910 SV V2 positive tests */
+    g_assert_true (TELIT_MODEL_LE910_SV_V2 == mm_telit_get_model(le910_pid, "LE910 SV V2"));
+    g_assert_true (TELIT_MODEL_LE910_SV_V2 == mm_telit_get_model(le910_pid, "LE910 V2 SV"));
+    g_assert_true (TELIT_MODEL_LE910_SV_V2 == mm_telit_get_model(le910_pid, "LE910-SV-V2"));
+    g_assert_true (TELIT_MODEL_LE910_SV_V2 == mm_telit_get_model(le910_pid, "LE910_SV_V2"));
+    /* LE910 SV V2 negative tests */
+    g_assert_false (TELIT_MODEL_LE910_SV_V2 == mm_telit_get_model(le910_pid, "LE910 V2"));
+    g_assert_false (TELIT_MODEL_LE910_SV_V2 == mm_telit_get_model(le910_pid, "LE910 SV"));
+    g_assert_false (TELIT_MODEL_LE910_SV_V2 == mm_telit_get_model(le910_pid, "LE910 NA V2"));
+}
+
+static void
+test_mm_telit_get_model_supported_bands(void)
+{
+    guint i;
+    GArray *bands = NULL;
+
+    MMModemBand he910_eu_exp_bands[] = {
+                               MM_MODEM_BAND_EGSM,
+                               MM_MODEM_BAND_DCS,
+                               MM_MODEM_BAND_PCS,
+                               MM_MODEM_BAND_G850,
+                               MM_MODEM_BAND_U800,
+                               MM_MODEM_BAND_U850,
+                               MM_MODEM_BAND_U900,
+                               MM_MODEM_BAND_U2100,
+    };
+    MMModemBand he910_na_exp_bands[] = {
+                               MM_MODEM_BAND_EGSM,
+                               MM_MODEM_BAND_DCS,
+                               MM_MODEM_BAND_PCS,
+                               MM_MODEM_BAND_G850,
+                               MM_MODEM_BAND_U800,
+                               MM_MODEM_BAND_U850,
+                               MM_MODEM_BAND_U900,
+                               MM_MODEM_BAND_U17IV
+    };
+    MMModemBand le910_eu_v2_exp_bands[] = {
+                                   MM_MODEM_BAND_EGSM,
+                                   MM_MODEM_BAND_DCS,
+                                   MM_MODEM_BAND_U2100,
+                                   MM_MODEM_BAND_U1800,
+                                   MM_MODEM_BAND_U900,
+                                   MM_MODEM_BAND_EUTRAN_I,
+                                   MM_MODEM_BAND_EUTRAN_III,
+                                   MM_MODEM_BAND_EUTRAN_VII,
+                                   MM_MODEM_BAND_EUTRAN_VIII,
+                                   MM_MODEM_BAND_EUTRAN_XX
+    };
+    MMModemBand le910_na_v2_exp_bands[] = {
+                                    MM_MODEM_BAND_G850,
+                                    MM_MODEM_BAND_PCS,
+                                    MM_MODEM_BAND_U850,
+                                    MM_MODEM_BAND_U1900,
+                                    MM_MODEM_BAND_U17IV,
+                                    MM_MODEM_BAND_EUTRAN_II,
+                                    MM_MODEM_BAND_EUTRAN_IV,
+                                    MM_MODEM_BAND_EUTRAN_V,
+                                    MM_MODEM_BAND_EUTRAN_XII,
+                                    MM_MODEM_BAND_EUTRAN_XIII,
+                                    MM_MODEM_BAND_EUTRAN_XVII,
+                                  };
+    MMModemBand le910_sv_v2_exp_bands[] = {
+                                   MM_MODEM_BAND_EUTRAN_II,
+                                   MM_MODEM_BAND_EUTRAN_IV,
+                                   MM_MODEM_BAND_EUTRAN_V,
+                                   MM_MODEM_BAND_EUTRAN_XII,
+                                   MM_MODEM_BAND_EUTRAN_XIII,
+                                   MM_MODEM_BAND_EUTRAN_XVII,
+                                 };
+
+    guint he910_eu_exp_bands_len = 8;
+    guint he910_na_exp_bands_len = 8;
+    guint le910_eu_v2_exp_bands_len = 10;
+    guint le910_na_v2_exp_bands_len = 11;
+    guint le910_sv_v2_exp_bands_len = 6;
+
+    /* HE910 EU */
+    g_assert_true (mm_telit_get_model_supported_bands (TELIT_MODEL_HE910_EU, &bands));
+    g_assert_cmpuint (he910_eu_exp_bands_len, ==, bands->len);
+
+    for(i = 0; i < bands->len; i++)
+        g_assert_cmpuint (he910_eu_exp_bands[i], ==, g_array_index (bands, TelitModel, i));
+
+    g_array_free(bands, TRUE);
+    bands = NULL;
+
+
+    /* HE910 NA */
+    g_assert_true (mm_telit_get_model_supported_bands (TELIT_MODEL_HE910_NA, &bands));
+    g_assert_cmpuint (he910_na_exp_bands_len, ==, bands->len);
+
+    for(i = 0; i < bands->len; i++)
+        g_assert_cmpuint (he910_na_exp_bands[i], ==, g_array_index (bands, TelitModel, i));
+
+    g_array_free(bands, TRUE);
+    bands = NULL;
+
+
+    /* LE910 EU V2*/
+    g_assert_true (mm_telit_get_model_supported_bands (TELIT_MODEL_LE910_EU_V2, &bands));
+    g_assert_cmpuint (le910_eu_v2_exp_bands_len, ==, bands->len);
+
+    for(i = 0; i < bands->len; i++)
+        g_assert_cmpuint (le910_eu_v2_exp_bands[i], ==, g_array_index (bands, TelitModel, i));
+
+    g_array_free(bands, TRUE);
+    bands = NULL;
+
+
+    /* LE910 NA V2*/
+    g_assert_true (mm_telit_get_model_supported_bands (TELIT_MODEL_LE910_NA_V2, &bands));
+    g_assert_cmpuint (le910_na_v2_exp_bands_len, ==, bands->len);
+
+    for(i = 0; i < bands->len; i++)
+        g_assert_cmpuint (le910_na_v2_exp_bands[i], ==, g_array_index (bands, TelitModel, i));
+
+    g_array_free(bands, TRUE);
+    bands = NULL;
+
+
+    /* LE910 SV V2*/
+    g_assert_true (mm_telit_get_model_supported_bands (TELIT_MODEL_LE910_SV_V2, &bands));
+    g_assert_cmpuint (le910_sv_v2_exp_bands_len, ==, bands->len);
+
+    for(i = 0; i < bands->len; i++)
+        g_assert_cmpuint (le910_sv_v2_exp_bands[i], ==, g_array_index (bands, TelitModel, i));
+
+    g_array_free(bands, TRUE);
+    bands = NULL;
+}
+
 int main (int argc, char **argv)
 {
     setlocale (LC_ALL, "");
@@ -99,6 +269,8 @@ int main (int argc, char **argv)
     g_type_init ();
     g_test_init (&argc, &argv, NULL);
 
-    g_test_add_func ("/MM/telit/csim", test_parse_csim_response);
+    g_test_add_func ("/MM/telit/csim", test_mm_telit_parse_csim_response);
+    g_test_add_func ("/MM/telit/bands/get_model", test_mm_telit_get_model);
+    g_test_add_func ("/MM/telit/bands/supported/complete", test_mm_telit_get_model_supported_bands);
     return g_test_run ();
 }
-- 
2.1.4



More information about the ModemManager-devel mailing list