Hi,
> > > +
> > > + if (send_by_one) {
> > > + gchar **topic_list = NULL;
> > > + gchar **topic_list_orig = NULL;
> > > +
> > > + topic_list = topic_list_orig = g_strsplit_set(topics, ",",
-1);
> > > +
> > > + for (; *topic_list; topic_list++) {
> > > + struct cb_data *cbd = cb_data_new(cb, user_data);
> > > +
> > > + buf = g_strdup_printf("AT+CSCB=0,\"%s\"",
*topic_list);
> > >
> > > - id = g_at_chat_send(data->chat, buf, none_prefix,
> > > + id = g_at_chat_send(data->chat, buf, none_prefix,
> > > at_cscb_set_cb, cbd, g_free);
> >
> > So this is not going to work out as nicely as you might think it would.
> > You keep calling ofono_cbs_set_cb_t callback now for every single topic
> > you send. And also as a result, the D-Bus call returns successful after
> > the first one.
>
> OK, I see.
>
> > You need to properly queue this and properly fail and roll back in case
> > of a failure.
>
> Roll back? You means that if there is a failure in the middle of sending,
you want to send AT command to remove the first topics?
at minimum clear all topics again.
Ok, I will do this.
> > I addition to that, I would prefer to send as many topics
at once as
> > possible. So how many can ZTE set at once?
>
> I can do some test, but I think that it's not related to topics, but to AT
command length. And we cannot guaranty to find another model more restrictive.
Sending one by one seems to be the 'safest' solution.
Please check this. And AT command length limitation would be funny. Not
unlikely, but funny.
And while at it, please check if it is actually capable of handling any
kind of topic ranges properly. You currently only split the topics, but
have no special handling for ranges. So if the modem does not handle
topic ranges, then you have a problem here.
Topic range is OK. You can have a look at the log.
ofonod[2040]: Aux: > AT+CSCB=0,"4352-4356"\r
ofonod[2040]: Aux: < \r\nOK\r\n
For example if it can only set 10 topics at once, and you give 1-11.
Is
this 11 topics and the modem can handle it. Or it can handle only 10
topics and would fail.
Another thing that came to mind, please check that it actually adds the
topics and not just overwrites it. Some manufactures don't read the AT
command specification carefully.
Seems to be fine.
So as you can see in the log, I have found the 'limit'.
at+cscb=0, "4352-4356,11000,10000,9000,8000,7000,6000,5000,1,2"
OK
at+cscb=0, "4352-4356,11000,10000,9000,8000,7000,6000,5000,1,21"
ERROR
50 characters inside the string is OK, but 51 not.
So do you prefer to use such limit, instead of sending one by one?
Regards,
Bertrand
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number: 302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.