wavecom: implement custom flow control handling
This commit is contained in:
@@ -36,6 +36,31 @@ static void iface_modem_init (MMIfaceModem *iface);
|
||||
G_DEFINE_TYPE_EXTENDED (MMBroadbandModemWavecom, mm_broadband_modem_wavecom, MM_TYPE_BROADBAND_MODEM, 0,
|
||||
G_IMPLEMENT_INTERFACE (MM_TYPE_IFACE_MODEM, iface_modem_init))
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Flow control (Modem interface) */
|
||||
|
||||
static gboolean
|
||||
setup_flow_control_finish (MMIfaceModem *self,
|
||||
GAsyncResult *res,
|
||||
GError **error)
|
||||
{
|
||||
return !!mm_base_modem_at_command_finish (MM_BASE_MODEM (self), res, error);
|
||||
}
|
||||
|
||||
static void
|
||||
setup_flow_control (MMIfaceModem *self,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
/* Wavecom doesn't have XOFF/XON flow control, so we enable RTS/CTS */
|
||||
mm_base_modem_at_command (MM_BASE_MODEM (self),
|
||||
"+IFC=2,2",
|
||||
3,
|
||||
FALSE,
|
||||
callback,
|
||||
user_data);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Modem power down (Modem interface) */
|
||||
|
||||
@@ -54,13 +79,12 @@ modem_power_down (MMIfaceModem *self,
|
||||
{
|
||||
/* Use AT+CFUN=4 for power down. It will stop the RF (IMSI detach), and
|
||||
* keeps access to the SIM */
|
||||
mm_base_modem_at_command (
|
||||
MM_BASE_MODEM (self),
|
||||
"+CFUN=4",
|
||||
3,
|
||||
FALSE,
|
||||
callback,
|
||||
user_data);
|
||||
mm_base_modem_at_command (MM_BASE_MODEM (self),
|
||||
"+CFUN=4",
|
||||
3,
|
||||
FALSE,
|
||||
callback,
|
||||
user_data);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
@@ -89,6 +113,8 @@ mm_broadband_modem_wavecom_init (MMBroadbandModemWavecom *self)
|
||||
static void
|
||||
iface_modem_init (MMIfaceModem *iface)
|
||||
{
|
||||
iface->setup_flow_control = setup_flow_control;
|
||||
iface->setup_flow_control_finish = setup_flow_control_finish;
|
||||
iface->modem_power_down = modem_power_down;
|
||||
iface->modem_power_down_finish = modem_power_down_finish;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user