On 03/30/2012 11:43 AM, Marcel Holtmann wrote:
Hi Jukka,

+             ServicesChanged(array{object, dict}, array{object})
+
+                     Signals a list of services that have been changed
+                     via the first array. And a list of service that
+                     have been removed via the second array.
+
+                     The list of added services is sorted. The dictionary
+                     with the properties might be empty in case none of
+                     the properties have changed. Or only contains the
+                     properties that have changed.
+
+                     For newly added services the whole set of properties
+                     will be present.
+
+                     The list of removed services can be empty.
+
+                     This signal will only be triggered when the sort
+                     order of the service list or the number of services
+                     changes. It will not be emitted if only a property
+                     of the service object changes. For that it is
+                     required to watch the PropertyChanged signal of
+                     the service object.
+

so I might need to give some background here. We are trying to promote
the final stable 1.0 API and this is the last piece that is still open.
It has been discussed on IRC and F2F as well, but not a full conclusion
has been reached.

Problem is that the order of service can change. Either by a service
being connected or if the signal strength changed. There was no way to
signal this change right now.

The other problem is that ServicesAdded and ServicesRemoved signals have
a weird dependency on ServicesRemoved being send before ServicesAdded in
case services get removed and added at the same time. While this seems
fine, it is a potential race condition since the signal order leaving
ConnMan might not be the same when arriving at the client.

To solve both problems, we should just combine both signals into one
called ServicesChanged and have it list the added and removed services
in one go.

How the client can figure out what happened in these two cases:

1. service is removed and then immediately added (service now exists)
2. service is added and then immediately removed (service does not
exist any more)

so we would get only one signal in this case but the end result is
quite different from client point of view as the client cannot know if
the service exists or not.

that is why the first array gives you the list of current services and
the second array gives the list of removed services. Why would this be a
problem?

No problem, just got confused how the signal works :)

In the case 2. there is actually not necessary to put the service in the removed array at all because clients have not yet seen the service added anyway.


Cheers,
Jukka
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to