Hi Bertrand,

> > > +
> > > + 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.

> > 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.

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.

Regards

Marcel


_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono

Reply via email to