Hi Pekka, On Mon, Aug 16, 2010 at 02:40:59PM +0300, Pekka Pessi wrote: > Hi Samuel, > > 2010/8/14 Samuel Ortiz <[email protected]>: > >> Create modem only once GetProperties succeed, thus avoiding races with > >> PropertyChanged. > > So you mean races between the ofono_connect() and the manager_watch() code > > paths ? Could you give more details ? > > I mean races between modem_properties_reply() and modem_watch(). Ok, so what you're trying to achieve is to have get_imsi() called at modem creation time and from modem_changed(), and not from modem_properties_reply() (unless the modem is not created yet), right ?
> Currently it has effect only in pathological cases but as I plan to > create the device (and gain access to its permanent_powered) earlier, > the race becomes annoying. > > >> Do not call GetProperties on existing modem. > > Aren't we then losing the point of watching the manager interface, except > > for > > toggling the modem's available flag ? > ... > > Some additional comments/questions on your code: > > So you're creating the modem at ofono_connect() time, and then whenever we > > get > > a modem changed signal, we just use it to toggle the available flag ? > > The current code and my patch both create a modem when it registers > itself within ofono (it gets an object path) and destroy the modem > struct when the modem's object path is no more included in the > ModemManager Modem property list. Both the ofono_connect and modem > manager watch call update_modems(). > > The available flag is used by the update_modems() to weed out the > modems not included in the list. As my patch postpone creation of the > modem struct until the reply to the Modem.GetProperties is received, > the available flag is not modified by add_modem() but only by > update_modems(). Sure, but it seems to me that with your code we no longer handle the Powered Modem property change once a modem is created. I suspect this is only useful at modem creation time, when we need to actually power the modem up though. Cheers, Samuel. > > -- > Pekka.Pessi mail at nokia.com > _______________________________________________ > connman mailing list > [email protected] > http://lists.connman.net/listinfo/connman -- Intel Open Source Technology Centre http://oss.intel.com/ _______________________________________________ connman mailing list [email protected] http://lists.connman.net/listinfo/connman
