#include "gatresult.h"
#include "atmodem.h"
+#include "vendor.h"
static const char *none_prefix[] = { NULL };
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)
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,
data = g_new0(struct cbs_data, 1);
data->chat = chat;
+ data->vendor = vendor;
ofono_cbs_set_data(cbs, data);