From 681a24c8d87cad064696d1dcf17ec78a23823d0c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 2 Feb 2012 21:09:48 -0600 Subject: [PATCH] novatel: override message storage and notification It seems that even though the firmware says it supports specific CNMI notification values, it really doesn't. Also set storage to the SIM until we support automatically determining the right storage in MM. XU870 does not support ME storage according to +CPMS=?. --- plugins/mm-modem-novatel-gsm.c | 40 ++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/plugins/mm-modem-novatel-gsm.c b/plugins/mm-modem-novatel-gsm.c index 706664c5..05eb8e15 100644 --- a/plugins/mm-modem-novatel-gsm.c +++ b/plugins/mm-modem-novatel-gsm.c @@ -325,15 +325,55 @@ mm_modem_novatel_gsm_init (MMModemNovatelGsm *self) { } +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_SMS_INDICATION_ENABLE_CMD: + /* Many Qualcomm chipsets don't support mode=2 */ + g_value_set_string (value, "+CNMI=1,1,2,1,0"); + break; + case MM_GENERIC_GSM_PROP_SMS_STORAGE_LOCATION_CMD: + g_value_set_string (value, "+CPMS=\"SM\",\"SM\",\"SM\""); + break; + default: + break; + } +} + static void mm_modem_novatel_gsm_class_init (MMModemNovatelGsmClass *klass) { + GObjectClass *object_class = G_OBJECT_CLASS (klass); MMGenericGsmClass *gsm_class = MM_GENERIC_GSM_CLASS (klass); mm_modem_novatel_gsm_parent_class = g_type_class_peek_parent (klass); + object_class->get_property = get_property; + object_class->set_property = set_property; + gsm_class->set_allowed_mode = set_allowed_mode; gsm_class->get_allowed_mode = get_allowed_mode; gsm_class->get_access_technology = get_access_technology; + + g_object_class_override_property (object_class, + MM_GENERIC_GSM_PROP_SMS_INDICATION_ENABLE_CMD, + MM_GENERIC_GSM_SMS_INDICATION_ENABLE_CMD); + + g_object_class_override_property (object_class, + MM_GENERIC_GSM_PROP_SMS_STORAGE_LOCATION_CMD, + MM_GENERIC_GSM_SMS_STORAGE_LOCATION_CMD); }