novatel: flip secondary ports to AT mode during port setup
This commit is contained in:
@@ -31,6 +31,26 @@
|
|||||||
|
|
||||||
G_DEFINE_TYPE (MMBroadbandModemNovatel, mm_broadband_modem_novatel, MM_TYPE_BROADBAND_MODEM);
|
G_DEFINE_TYPE (MMBroadbandModemNovatel, mm_broadband_modem_novatel, MM_TYPE_BROADBAND_MODEM);
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* Setup ports (Broadband modem class) */
|
||||||
|
|
||||||
|
static const MMBaseModemAtCommand nwdmat_sequence[] = {
|
||||||
|
{ "$NWDMAT=1", 3, FALSE, mm_base_modem_response_processor_continue_on_error },
|
||||||
|
{ "$NWDMAT=1", 3, FALSE, mm_base_modem_response_processor_continue_on_error },
|
||||||
|
{ "$NWDMAT=1", 3, FALSE, NULL },
|
||||||
|
{ NULL }
|
||||||
|
};
|
||||||
|
|
||||||
|
static void
|
||||||
|
setup_ports (MMBroadbandModem *self)
|
||||||
|
{
|
||||||
|
/* Call parent's setup ports first always */
|
||||||
|
MM_BROADBAND_MODEM_CLASS (mm_broadband_modem_novatel_parent_class)->setup_ports (self);
|
||||||
|
|
||||||
|
/* Flip secondary ports to AT mode */
|
||||||
|
mm_base_modem_at_sequence (MM_BASE_MODEM (self), nwdmat_sequence, NULL, NULL, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
MMBroadbandModemNovatel *
|
MMBroadbandModemNovatel *
|
||||||
@@ -57,4 +77,7 @@ mm_broadband_modem_novatel_init (MMBroadbandModemNovatel *self)
|
|||||||
static void
|
static void
|
||||||
mm_broadband_modem_novatel_class_init (MMBroadbandModemNovatelClass *klass)
|
mm_broadband_modem_novatel_class_init (MMBroadbandModemNovatelClass *klass)
|
||||||
{
|
{
|
||||||
|
MMBroadbandModemClass *broadband_modem_class = MM_BROADBAND_MODEM_CLASS (klass);
|
||||||
|
|
||||||
|
broadband_modem_class->setup_ports = setup_ports;
|
||||||
}
|
}
|
||||||
|
@@ -397,6 +397,23 @@ mm_base_modem_response_processor_no_result_continue (MMBaseModem *self,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
mm_base_modem_response_processor_continue_on_error (MMBaseModem *self,
|
||||||
|
gpointer none,
|
||||||
|
const gchar *command,
|
||||||
|
const gchar *response,
|
||||||
|
gboolean last_command,
|
||||||
|
const GError *error,
|
||||||
|
GVariant **result,
|
||||||
|
GError **result_error)
|
||||||
|
{
|
||||||
|
if (error)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
*result = NULL;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* Single AT command handling */
|
/* Single AT command handling */
|
||||||
|
|
||||||
|
@@ -120,6 +120,15 @@ gboolean mm_base_modem_response_processor_no_result_continue (MMBaseModem *self,
|
|||||||
const GError *error,
|
const GError *error,
|
||||||
GVariant **result,
|
GVariant **result,
|
||||||
GError **result_error);
|
GError **result_error);
|
||||||
|
/* If error, continue sequence, otherwise finish it */
|
||||||
|
gboolean mm_base_modem_response_processor_continue_on_error (MMBaseModem *self,
|
||||||
|
gpointer none,
|
||||||
|
const gchar *command,
|
||||||
|
const gchar *response,
|
||||||
|
gboolean last_command,
|
||||||
|
const GError *error,
|
||||||
|
GVariant **result,
|
||||||
|
GError **result_error);
|
||||||
|
|
||||||
/* Generic AT command handling, using the best AT port available and without
|
/* Generic AT command handling, using the best AT port available and without
|
||||||
* explicit cancellations. */
|
* explicit cancellations. */
|
||||||
|
Reference in New Issue
Block a user