telit,helpers: fix format of flags built during #BND request generation

We explicitly need 64bit values for 3G flags and 4G flags.
This commit is contained in:
Aleksander Morgado
2020-01-30 18:00:52 +01:00
parent ee8e81e55c
commit 759ab6d94d

View File

@@ -202,8 +202,8 @@ mm_telit_build_bnd_request (GArray *bands_array,
guint64 mask4g = 0; guint64 mask4g = 0;
guint i; guint i;
gint flag2g = -1; gint flag2g = -1;
gint flag3g = -1; gint64 flag3g = -1;
gint flag4g = -1; gint64 flag4g = -1;
gchar *cmd; gchar *cmd;
const guint64 *telit_3g_to_mm_band_mask; const guint64 *telit_3g_to_mm_band_mask;
guint telit_3g_to_mm_band_mask_n_elements; 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 */ /* 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 /* If the modem supports a given access tech, we must always give band settings
* for the specific tech */ * 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) if (modem_is_2g && !modem_is_3g && !modem_is_4g)
cmd = g_strdup_printf ("#BND=%d", flag2g); cmd = g_strdup_printf ("#BND=%d", flag2g);
else if (!modem_is_2g && modem_is_3g && !modem_is_4g) 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) 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) 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) 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) 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) 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 else
g_assert_not_reached (); g_assert_not_reached ();