summaryrefslogtreecommitdiffstats
path: root/drivers/atmodem
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2012-12-04 23:45:35 -0600
committerDenis Kenzior <denkenz@gmail.com>2012-12-04 23:47:58 -0600
commit25e7ecd3c783d03e833938c617e4507bf6e9394a (patch)
tree3a3905191032a8f05d2928a643bf57429fd73e5a /drivers/atmodem
parent788922cbdf1dbe590a23423301afb5d23379704c (diff)
downloadofono-25e7ecd3c783d03e833938c617e4507bf6e9394a.tar.bz2
atmodem: Re-work the CBS driver
We might have mis-interpreted how 27.007 intends for CBS to work. After studying the implementation notes of the IMC 6260 modem, the spec intent made a little bit more sense.
Diffstat (limited to 'drivers/atmodem')
-rw-r--r--drivers/atmodem/cbs.c32
1 files changed, 6 insertions, 26 deletions
diff --git a/drivers/atmodem/cbs.c b/drivers/atmodem/cbs.c
index 217445fb..3c491be0 100644
--- a/drivers/atmodem/cbs.c
+++ b/drivers/atmodem/cbs.c
@@ -45,7 +45,6 @@ static const char *cscb_prefix[] = { "+CSCB:", NULL };
struct cbs_data {
GAtChat *chat;
- gboolean cscb_mode_1;
unsigned int vendor;
};
@@ -118,14 +117,11 @@ static void at_cbs_set_topics(struct ofono_cbs *cbs, const char *topics,
/* 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.
*/
switch (data->vendor) {
case OFONO_VENDOR_GOBI:
case OFONO_VENDOR_QUALCOMM_MSM:
- g_at_chat_send(data->chat, "AT+CSCB=1", none_prefix,
+ g_at_chat_send(data->chat, "AT+CSCB=0", none_prefix,
NULL, NULL, NULL);
break;
default:
@@ -152,16 +148,10 @@ static void at_cbs_clear_topics(struct ofono_cbs *cbs,
{
struct cbs_data *data = ofono_cbs_get_data(cbs);
struct cb_data *cbd = cb_data_new(cb, user_data);
- char buf[256];
DBG("");
- if (data->cscb_mode_1)
- snprintf(buf, sizeof(buf), "AT+CSCB=1,\"0-65535\"");
- else
- snprintf(buf, sizeof(buf), "AT+CSCB=0,\"\"");
-
- if (g_at_chat_send(data->chat, buf, none_prefix,
+ if (g_at_chat_send(data->chat, "AT+CSCB=0", none_prefix,
at_cscb_set_cb, cbd, g_free) > 0)
return;
@@ -194,7 +184,6 @@ static void at_cscb_support_cb(gboolean ok, GAtResult *result, gpointer user)
struct cbs_data *data = ofono_cbs_get_data(cbs);
gint range[2];
GAtResultIter iter;
- char buf[256];
if (!ok)
goto error;
@@ -208,21 +197,12 @@ static void at_cscb_support_cb(gboolean ok, GAtResult *result, gpointer user)
goto error;
while (g_at_result_iter_next_range(&iter, &range[0], &range[1]))
- if (1 >= range[0] && 1 <= range[1])
- data->cscb_mode_1 = TRUE;
-
- g_at_result_iter_close_list(&iter);
+ ;
- /* Assume that if CSCB mode 1 is supported, then we need to use
- * it to remove topics, otherwise we need to set the entire list
- * of new topics using CSCB mode 0.
- */
- if (data->cscb_mode_1)
- snprintf(buf, sizeof(buf), "AT+CSCB=1,\"0-65535\"");
- else
- snprintf(buf, sizeof(buf), "AT+CSCB=0,\"\"");
+ if (!g_at_result_iter_close_list(&iter))
+ goto error;
- if (g_at_chat_send(data->chat, buf, none_prefix,
+ if (g_at_chat_send(data->chat, "AT+CSCB=0", none_prefix,
at_cbs_register, cbs, NULL) > 0)
return;