Hi, Padovan > > > > In current connman implementation, when we turn on/off > airplane mode > > quickly, sometimes, it may lead to device status conflict. > > For example, initial status is airplane mode off, bluetooth > device on, > > then when we turn on/off airplane mode qucikly, bluetooth > device will > > be enabled and disabled according to it. But the bluetooth > > enable/disable operation is asynchronous, in some time, for > example if > > the device is in the progress of powering on but not > powered completed > > yet, then turn on airplane mode, which means to disable the > bluetooth > > device, connman will treat it as the same device status and > ignore the > > operation, then the status would be turned to airplane mode on, > > bluetooth device on, which can't keep consistent with the > initial status. > > > > This patch is trying to fix this issue, and the solution is > when the > > device is in powering progress, forbid upper layer to call manager > > dbus interface to set "OfflineMode" properity. > > What if instead forbid the call, you just defer the reply of > SetProperty(OfflineMode) until we got confirmation that > everything is off? > You just need to turn SetProperty() async and when ready send > the reply. > Thanks for your suggestion, but I have some questions about your solution, and wish you can give me some instructions:
If we defer the reply of SetProperity(OfflineMode) until everything is off, then: 1. Do you mean that upper layer app will always block and wait until the dbus reply returns? If not, it seems it can not resolve this issue. 2. Even if that the upper layer app will block and wait until the dbus reply returns, in the function of SetProperity, when set "OfflineMode" properity, it also needs to check whether the dbus message is pending or not, right? 3. I found that it is not easy to implement pending the dbus message reply in SetProperity(OfflineMode), when all the devices enable/disable operations are done, how to check it in manager.c and then send the dbus reply? If we create a while loop to continuous check the device status in manager.c, it will block the main loop, so how to implment it? _______________________________________________ connman mailing list [email protected] http://lists.connman.net/listinfo/connman
