mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-06 12:38:10 +02:00
hso: only turn off unsolicited dial messages after dialing
This commit is contained in:
parent
a01940cda8
commit
3ea65cdd39
1 changed files with 9 additions and 2 deletions
|
|
@ -43,6 +43,7 @@ G_DEFINE_TYPE (NMHsoGsmDevice, nm_hso_gsm_device, NM_TYPE_GSM_DEVICE)
|
||||||
extern const DBusGObjectInfo dbus_glib_nm_gsm_device_object_info;
|
extern const DBusGObjectInfo dbus_glib_nm_gsm_device_object_info;
|
||||||
|
|
||||||
#define GSM_CID "gsm-cid"
|
#define GSM_CID "gsm-cid"
|
||||||
|
#define HSO_CALL_STARTED "call-started"
|
||||||
#define HSO_SECRETS_TRIES "gsm-secrets-tries"
|
#define HSO_SECRETS_TRIES "gsm-secrets-tries"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
@ -123,12 +124,17 @@ hso_call_done (NMSerialDevice *device,
|
||||||
const char *reply,
|
const char *reply,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
|
NMActRequest *req;
|
||||||
gboolean success = FALSE;
|
gboolean success = FALSE;
|
||||||
|
|
||||||
switch (reply_index) {
|
switch (reply_index) {
|
||||||
case 0:
|
case 0:
|
||||||
nm_info ("Connected, Woo!");
|
nm_info ("Connected, Woo!");
|
||||||
success = TRUE;
|
success = TRUE;
|
||||||
|
|
||||||
|
req = nm_device_get_act_request (NM_DEVICE (device));
|
||||||
|
g_assert (req);
|
||||||
|
g_object_set_data (G_OBJECT (req), HSO_CALL_STARTED, GUINT_TO_POINTER (TRUE));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
nm_warning ("Connect request failed");
|
nm_warning ("Connect request failed");
|
||||||
|
|
@ -426,7 +432,7 @@ real_deactivate_quickly (NMDevice *device)
|
||||||
NMHsoGsmDevicePrivate *priv = NM_HSO_GSM_DEVICE_GET_PRIVATE (device);
|
NMHsoGsmDevicePrivate *priv = NM_HSO_GSM_DEVICE_GET_PRIVATE (device);
|
||||||
NMActRequest *req;
|
NMActRequest *req;
|
||||||
NMConnection *connection;
|
NMConnection *connection;
|
||||||
guint cid;
|
guint cid, call_started;
|
||||||
char *command;
|
char *command;
|
||||||
|
|
||||||
if (priv->pending_ip4_config) {
|
if (priv->pending_ip4_config) {
|
||||||
|
|
@ -438,7 +444,8 @@ real_deactivate_quickly (NMDevice *device)
|
||||||
req = nm_device_get_act_request (device);
|
req = nm_device_get_act_request (device);
|
||||||
if (req) {
|
if (req) {
|
||||||
cid = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (req), GSM_CID));
|
cid = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (req), GSM_CID));
|
||||||
if (cid) {
|
call_started = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (req), HSO_CALL_STARTED));
|
||||||
|
if (cid && call_started) {
|
||||||
const char *responses[] = { "OK", "ERROR", "ERR", NULL };
|
const char *responses[] = { "OK", "ERROR", "ERR", NULL };
|
||||||
int reply;
|
int reply;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue