summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2010-06-09 18:40:59 -0700
committerMarcel Holtmann <marcel@holtmann.org>2010-06-09 18:40:59 -0700
commita774d9ed4932f4a6a2bbdf590d3f83e490cf12d9 (patch)
treec19355b6df31fc7674eba6206cf096f9ae0c4b43
parent88d083c4fd648eec0ee424085156b9a1de920876 (diff)
downloadofono-a774d9ed4932f4a6a2bbdf590d3f83e490cf12d9.tar.bz2
Add quirk for Qualcomm issues with setting CBS topic ranges
-rw-r--r--drivers/atmodem/cbs.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/atmodem/cbs.c b/drivers/atmodem/cbs.c
index eb46d30d..a1c40377 100644
--- a/drivers/atmodem/cbs.c
+++ b/drivers/atmodem/cbs.c
@@ -38,6 +38,7 @@
#include "gatresult.h"
#include "atmodem.h"
+#include "vendor.h"
static const char *none_prefix[] = { NULL };
static const char *cscb_prefix[] = { "+CSCB:", NULL };
@@ -45,6 +46,7 @@ static const char *cscb_prefix[] = { "+CSCB:", NULL };
struct cbs_data {
GAtChat *chat;
gboolean cscb_mode_1;
+ unsigned int vendor;
};
static void at_cbm_notify(GAtResult *result, gpointer user_data)
@@ -113,6 +115,17 @@ static void at_cbs_set_topics(struct ofono_cbs *cbs, const char *topics,
if (!cbd)
goto error;
+ /* For the Qualcomm based devices it is required to clear
+ * the list of topics first. Otherwise setting the new
+ * topic ranges will fail.
+ *
+ * In addition only AT+CSCB=1 seems to work. Providing
+ * a topic range for clearing makes AT+CSBC=0,... fail.
+ */
+ if (data->vendor == OFONO_VENDOR_QUALCOMM_MSM)
+ g_at_chat_send(data->chat, "AT+CSCB=1", none_prefix,
+ NULL, NULL, NULL);
+
buf = g_strdup_printf("AT+CSCB=0,\"%s\"", topics);
id = g_at_chat_send(data->chat, buf, none_prefix,
@@ -225,6 +238,7 @@ static int at_cbs_probe(struct ofono_cbs *cbs, unsigned int vendor,
data = g_new0(struct cbs_data, 1);
data->chat = chat;
+ data->vendor = vendor;
ofono_cbs_set_data(cbs, data);