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

-- 
Pekka.Pessi mail at nokia.com
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to