diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2020-01-30 18:00:52 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2020-01-31 14:52:49 +0100 |
commit | 759ab6d94d2d34c5df2f665e7afbe0a66a1f7541 (patch) | |
tree | 279925d3ab6d6996eabfc7c1cca67b9869bfec70 | |
parent | ee8e81e55c187c3f1feca230d137fb25400a565e (diff) |
telit,helpers: fix format of flags built during #BND request generation
We explicitly need 64bit values for 3G flags and 4G flags.
-rw-r--r-- | plugins/telit/mm-modem-helpers-telit.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/plugins/telit/mm-modem-helpers-telit.c b/plugins/telit/mm-modem-helpers-telit.c index bff9c0dd..07d46b8d 100644 --- a/plugins/telit/mm-modem-helpers-telit.c +++ b/plugins/telit/mm-modem-helpers-telit.c @@ -202,8 +202,8 @@ mm_telit_build_bnd_request (GArray *bands_array, guint64 mask4g = 0; guint i; gint flag2g = -1; - gint flag3g = -1; - gint flag4g = -1; + gint64 flag3g = -1; + gint64 flag4g = -1; gchar *cmd; const guint64 *telit_3g_to_mm_band_mask; guint telit_3g_to_mm_band_mask_n_elements; @@ -281,7 +281,7 @@ mm_telit_build_bnd_request (GArray *bands_array, } /* Get 4G-specific telit band bitmask */ - flag4g = (mask4g != 0) ? mask4g : -1; + flag4g = (mask4g != 0) ? ((gint64)mask4g) : -1; /* If the modem supports a given access tech, we must always give band settings * for the specific tech */ @@ -304,17 +304,17 @@ mm_telit_build_bnd_request (GArray *bands_array, if (modem_is_2g && !modem_is_3g && !modem_is_4g) cmd = g_strdup_printf ("#BND=%d", flag2g); else if (!modem_is_2g && modem_is_3g && !modem_is_4g) - cmd = g_strdup_printf ("#BND=0,%d", flag3g); + cmd = g_strdup_printf ("#BND=0,%" G_GINT64_FORMAT, flag3g); else if (!modem_is_2g && !modem_is_3g && modem_is_4g) - cmd = g_strdup_printf ("#BND=0,0,%d", flag4g); + cmd = g_strdup_printf ("#BND=0,0,%" G_GINT64_FORMAT, flag4g); else if (modem_is_2g && modem_is_3g && !modem_is_4g) - cmd = g_strdup_printf ("#BND=%d,%d", flag2g, flag3g); + cmd = g_strdup_printf ("#BND=%d,%" G_GINT64_FORMAT, flag2g, flag3g); else if (!modem_is_2g && modem_is_3g && modem_is_4g) - cmd = g_strdup_printf ("#BND=0,%d,%d", flag3g, flag4g); + cmd = g_strdup_printf ("#BND=0,%" G_GINT64_FORMAT ",%" G_GINT64_FORMAT, flag3g, flag4g); else if (modem_is_2g && !modem_is_3g && modem_is_4g) - cmd = g_strdup_printf ("#BND=%d,0,%d", flag2g, flag4g); + cmd = g_strdup_printf ("#BND=%d,0,%" G_GINT64_FORMAT, flag2g, flag4g); else if (modem_is_2g && modem_is_3g && modem_is_4g) - cmd = g_strdup_printf ("#BND=%d,%d,%d", flag2g, flag3g, flag4g); + cmd = g_strdup_printf ("#BND=%d,%" G_GINT64_FORMAT ",%" G_GINT64_FORMAT, flag2g, flag3g, flag4g); else g_assert_not_reached (); |