samsung: fix access technology detection
Need to send the MM allowed mode back to the caller, not the Icera mode. Simple typo in original plugin patch I think.
This commit is contained in:
@@ -150,24 +150,24 @@ static gint samsung_get_cid (MMModemSamsungGsm *self)
|
|||||||
static gboolean
|
static gboolean
|
||||||
parse_ipsys (MMModemSamsungGsm *self,
|
parse_ipsys (MMModemSamsungGsm *self,
|
||||||
const char *reply,
|
const char *reply,
|
||||||
int *mode,
|
|
||||||
int *domain,
|
|
||||||
MMModemGsmAllowedMode *out_mode)
|
MMModemGsmAllowedMode *out_mode)
|
||||||
{
|
{
|
||||||
|
int mode, domain;
|
||||||
|
|
||||||
if (reply == NULL || !g_str_has_prefix (reply, "%IPSYS:"))
|
if (reply == NULL || !g_str_has_prefix (reply, "%IPSYS:"))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (sscanf (reply + 7, "%d,%d", mode, domain) == 2) {
|
if (sscanf (reply + 7, "%d,%d", &mode, &domain) == 2) {
|
||||||
MMModemGsmAllowedMode new_mode = MM_MODEM_GSM_ALLOWED_MODE_ANY;
|
MMModemGsmAllowedMode new_mode = MM_MODEM_GSM_ALLOWED_MODE_ANY;
|
||||||
|
|
||||||
/* Network mode */
|
/* Network mode */
|
||||||
if (*mode == 2)
|
if (mode == 2)
|
||||||
new_mode = MM_MODEM_GSM_ALLOWED_MODE_2G_PREFERRED;
|
new_mode = MM_MODEM_GSM_ALLOWED_MODE_2G_PREFERRED;
|
||||||
else if (*mode == 3)
|
else if (mode == 3)
|
||||||
new_mode = MM_MODEM_GSM_ALLOWED_MODE_3G_PREFERRED;
|
new_mode = MM_MODEM_GSM_ALLOWED_MODE_3G_PREFERRED;
|
||||||
else if (*mode == 0)
|
else if (mode == 0)
|
||||||
new_mode = MM_MODEM_GSM_ALLOWED_MODE_2G_ONLY;
|
new_mode = MM_MODEM_GSM_ALLOWED_MODE_2G_ONLY;
|
||||||
else if (*mode == 1)
|
else if (mode == 1)
|
||||||
new_mode = MM_MODEM_GSM_ALLOWED_MODE_3G_ONLY;
|
new_mode = MM_MODEM_GSM_ALLOWED_MODE_3G_ONLY;
|
||||||
|
|
||||||
if (out_mode)
|
if (out_mode)
|
||||||
@@ -188,13 +188,12 @@ get_allowed_mode_done (MMAtSerialPort *port,
|
|||||||
{
|
{
|
||||||
MMCallbackInfo *info = (MMCallbackInfo *) user_data;
|
MMCallbackInfo *info = (MMCallbackInfo *) user_data;
|
||||||
MMModemSamsungGsm *self = MM_MODEM_SAMSUNG_GSM (info->modem);
|
MMModemSamsungGsm *self = MM_MODEM_SAMSUNG_GSM (info->modem);
|
||||||
int mode, domain;
|
MMModemGsmAllowedMode allowed = MM_MODEM_GSM_ALLOWED_MODE_ANY;
|
||||||
MMModemGsmAllowedMode mode_out = MM_MODEM_GSM_ALLOWED_MODE_ANY;
|
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
info->error = g_error_copy (error);
|
info->error = g_error_copy (error);
|
||||||
else if (parse_ipsys (self, response->str, &mode, &domain, &mode_out))
|
else if (parse_ipsys (self, response->str, &allowed))
|
||||||
mm_callback_info_set_result (info, GUINT_TO_POINTER (mode), NULL);
|
mm_callback_info_set_result (info, GUINT_TO_POINTER (allowed), NULL);
|
||||||
|
|
||||||
mm_callback_info_schedule (info);
|
mm_callback_info_schedule (info);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user