diff options
author | Alexander Orlov <alxorlov2@gmail.com> | 2012-07-23 10:08:27 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-07-23 10:08:27 +0200 |
commit | e6307e4844f4ebebeb3eca8612b2d16558528124 (patch) | |
tree | 65c735f461b186a14cb0cdef59c7ff158ff24be7 | |
parent | afc151fae4dd5ddbe6af61e0b5d8ca2cd39295b6 (diff) |
zte: add CFUN=4 power down property
Use CFUN=4 to disable radios, keeping access to the SIM
-rw-r--r-- | plugins/mm-modem-zte.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/plugins/mm-modem-zte.c b/plugins/mm-modem-zte.c index d1ae4713..9eb9dd09 100644 --- a/plugins/mm-modem-zte.c +++ b/plugins/mm-modem-zte.c @@ -682,6 +682,32 @@ grab_port (MMModem *modem, return !!port; } +static void +set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + /* Do nothing... see set_property() in parent, which also does nothing */ +} + +static void +get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + switch (prop_id) { + case MM_GENERIC_GSM_PROP_POWER_DOWN_CMD: + /* Use AT+CFUN=4 for power down. It will stop the RF (IMSI detach), and + * keeps access to the SIM */ + g_value_set_string (value, "+CFUN=4"); + break; + default: + break; + } +} + /*****************************************************************************/ static MMModemIceraPrivate * @@ -764,6 +790,13 @@ mm_modem_zte_class_init (MMModemZteClass *klass) mm_modem_zte_parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (object_class, sizeof (MMModemZtePrivate)); + object_class->get_property = get_property; + object_class->set_property = set_property; + + g_object_class_override_property (object_class, + MM_GENERIC_GSM_PROP_POWER_DOWN_CMD, + MM_GENERIC_GSM_POWER_DOWN_CMD); + object_class->dispose = dispose; gsm_class->do_enable = do_enable; gsm_class->do_disconnect = do_disconnect; |