cinterion: if modem removed don't process response
This commit is contained in:
@@ -164,11 +164,16 @@ get_2g_band_done (MMAtSerialPort *port,
|
|||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
MMCallbackInfo *info = (MMCallbackInfo *) user_data;
|
MMCallbackInfo *info = (MMCallbackInfo *) user_data;
|
||||||
MMModemCinterionGsmPrivate *priv = MM_MODEM_CINTERION_GSM_GET_PRIVATE (info->modem);
|
|
||||||
|
/* If the modem has already been removed, return without
|
||||||
|
* scheduling callback */
|
||||||
|
if (mm_callback_info_check_modem_removed (info))
|
||||||
|
return;
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
info->error = g_error_copy (error);
|
info->error = g_error_copy (error);
|
||||||
else {
|
else {
|
||||||
|
MMModemCinterionGsmPrivate *priv = MM_MODEM_CINTERION_GSM_GET_PRIVATE (info->modem);
|
||||||
guint32 mm_band = MM_MODEM_GSM_BAND_UNKNOWN;
|
guint32 mm_band = MM_MODEM_GSM_BAND_UNKNOWN;
|
||||||
GRegex *regex;
|
GRegex *regex;
|
||||||
GMatchInfo *match_info = NULL;
|
GMatchInfo *match_info = NULL;
|
||||||
@@ -235,11 +240,16 @@ get_3g_band_done (MMAtSerialPort *port,
|
|||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
MMCallbackInfo *info = (MMCallbackInfo *) user_data;
|
MMCallbackInfo *info = (MMCallbackInfo *) user_data;
|
||||||
MMModemCinterionGsmPrivate *priv = MM_MODEM_CINTERION_GSM_GET_PRIVATE (info->modem);
|
|
||||||
|
/* If the modem has already been removed, return without
|
||||||
|
* scheduling callback */
|
||||||
|
if (mm_callback_info_check_modem_removed (info))
|
||||||
|
return;
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
info->error = g_error_copy (error);
|
info->error = g_error_copy (error);
|
||||||
else {
|
else {
|
||||||
|
MMModemCinterionGsmPrivate *priv = MM_MODEM_CINTERION_GSM_GET_PRIVATE (info->modem);
|
||||||
guint32 mm_band = 0;
|
guint32 mm_band = 0;
|
||||||
GRegex *regex;
|
GRegex *regex;
|
||||||
GMatchInfo *match_info = NULL;
|
GMatchInfo *match_info = NULL;
|
||||||
@@ -335,12 +345,19 @@ set_band_done (MMAtSerialPort *port,
|
|||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
MMCallbackInfo *info = (MMCallbackInfo *) user_data;
|
MMCallbackInfo *info = (MMCallbackInfo *) user_data;
|
||||||
MMModemCinterionGsmPrivate *priv = MM_MODEM_CINTERION_GSM_GET_PRIVATE (info->modem);
|
|
||||||
|
/* If the modem has already been removed, return without
|
||||||
|
* scheduling callback */
|
||||||
|
if (mm_callback_info_check_modem_removed (info))
|
||||||
|
return;
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
info->error = g_error_copy (error);
|
info->error = g_error_copy (error);
|
||||||
else
|
else {
|
||||||
|
MMModemCinterionGsmPrivate *priv = MM_MODEM_CINTERION_GSM_GET_PRIVATE (info->modem);
|
||||||
|
|
||||||
priv->current_bands = GPOINTER_TO_UINT (mm_callback_info_get_data (info, "new-band"));
|
priv->current_bands = GPOINTER_TO_UINT (mm_callback_info_get_data (info, "new-band"));
|
||||||
|
}
|
||||||
|
|
||||||
mm_callback_info_schedule (info);
|
mm_callback_info_schedule (info);
|
||||||
}
|
}
|
||||||
@@ -545,11 +562,16 @@ get_smong_cb (MMAtSerialPort *port,
|
|||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
MMCallbackInfo *info = user_data;
|
MMCallbackInfo *info = user_data;
|
||||||
MMModemCinterionGsmPrivate *priv = MM_MODEM_CINTERION_GSM_GET_PRIVATE (info->modem);
|
MMModemCinterionGsmPrivate *priv;
|
||||||
MMModemGsmAccessTech act = MM_MODEM_GSM_ACCESS_TECH_UNKNOWN;
|
MMModemGsmAccessTech act = MM_MODEM_GSM_ACCESS_TECH_UNKNOWN;
|
||||||
GMatchInfo *match_info = NULL;
|
GMatchInfo *match_info = NULL;
|
||||||
GRegex *regex;
|
GRegex *regex;
|
||||||
|
|
||||||
|
/* If the modem has already been removed, return without
|
||||||
|
* scheduling callback */
|
||||||
|
if (mm_callback_info_check_modem_removed (info))
|
||||||
|
return;
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
info->error = g_error_copy (error);
|
info->error = g_error_copy (error);
|
||||||
mm_callback_info_set_result (info, GUINT_TO_POINTER (act), NULL);
|
mm_callback_info_set_result (info, GUINT_TO_POINTER (act), NULL);
|
||||||
@@ -557,6 +579,8 @@ get_smong_cb (MMAtSerialPort *port,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
priv = MM_MODEM_CINTERION_GSM_GET_PRIVATE (info->modem);
|
||||||
|
|
||||||
/* The AT^SMONG command returns a cell info table, where the second
|
/* The AT^SMONG command returns a cell info table, where the second
|
||||||
* column identifies the "GPRS status", which is exactly what we want.
|
* column identifies the "GPRS status", which is exactly what we want.
|
||||||
* So we'll try to read that second number in the values row.
|
* So we'll try to read that second number in the values row.
|
||||||
@@ -605,6 +629,11 @@ get_sind_cb (MMAtSerialPort *port,
|
|||||||
GMatchInfo *match_info = NULL;
|
GMatchInfo *match_info = NULL;
|
||||||
GRegex *regex;
|
GRegex *regex;
|
||||||
|
|
||||||
|
/* If the modem has already been removed, return without
|
||||||
|
* scheduling callback */
|
||||||
|
if (mm_callback_info_check_modem_removed (info))
|
||||||
|
return;
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
info->error = g_error_copy (error);
|
info->error = g_error_copy (error);
|
||||||
mm_callback_info_set_result (info, GUINT_TO_POINTER (act), NULL);
|
mm_callback_info_set_result (info, GUINT_TO_POINTER (act), NULL);
|
||||||
@@ -690,12 +719,19 @@ set_allowed_mode_cb (MMAtSerialPort *port,
|
|||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
MMCallbackInfo *info = (MMCallbackInfo *) user_data;
|
MMCallbackInfo *info = (MMCallbackInfo *) user_data;
|
||||||
MMModemCinterionGsmPrivate *priv = MM_MODEM_CINTERION_GSM_GET_PRIVATE (info->modem);
|
|
||||||
|
/* If the modem has already been removed, return without
|
||||||
|
* scheduling callback */
|
||||||
|
if (mm_callback_info_check_modem_removed (info))
|
||||||
|
return;
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
info->error = g_error_copy (error);
|
info->error = g_error_copy (error);
|
||||||
else
|
else {
|
||||||
|
MMModemCinterionGsmPrivate *priv = MM_MODEM_CINTERION_GSM_GET_PRIVATE (info->modem);
|
||||||
|
|
||||||
priv->allowed_mode = GPOINTER_TO_UINT (mm_callback_info_get_data (info, "new-mode"));
|
priv->allowed_mode = GPOINTER_TO_UINT (mm_callback_info_get_data (info, "new-mode"));
|
||||||
|
}
|
||||||
|
|
||||||
mm_callback_info_schedule (info);
|
mm_callback_info_schedule (info);
|
||||||
}
|
}
|
||||||
@@ -803,14 +839,21 @@ get_supported_networks_cb (MMAtSerialPort *port,
|
|||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
MMCallbackInfo *info = user_data;
|
MMCallbackInfo *info = user_data;
|
||||||
MMModemCinterionGsmPrivate *priv = MM_MODEM_CINTERION_GSM_GET_PRIVATE (info->modem);
|
MMModemCinterionGsmPrivate *priv;
|
||||||
GError *inner_error = NULL;
|
GError *inner_error = NULL;
|
||||||
|
|
||||||
|
/* If the modem has already been removed, return without
|
||||||
|
* scheduling callback */
|
||||||
|
if (mm_callback_info_check_modem_removed (info))
|
||||||
|
return;
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
enable_complete (MM_GENERIC_GSM (info->modem), error, info);
|
enable_complete (MM_GENERIC_GSM (info->modem), error, info);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
priv = MM_MODEM_CINTERION_GSM_GET_PRIVATE (info->modem);
|
||||||
|
|
||||||
/* Note: Documentation says that AT+WS46=? is replied with '+WS46:' followed
|
/* Note: Documentation says that AT+WS46=? is replied with '+WS46:' followed
|
||||||
* by a list of supported network modes between parenthesis, but the EGS5
|
* by a list of supported network modes between parenthesis, but the EGS5
|
||||||
* used to test this didn't use the 'WS46:' prefix. Also, more than one
|
* used to test this didn't use the 'WS46:' prefix. Also, more than one
|
||||||
|
Reference in New Issue
Block a user