Hi Brian,

On 15.07.2012 18:17, Brian Ruptash wrote:
> I'm running connman 1.1 with a single Ethernet interface and an
> ofono-managed 3G/GPRS modem.  The Ethernet service is in state 'online'
> and the modem in state 'idle', so there's practically nothing happenning
> in connman other than signal strength updates from the modem, and no
> changes in the services sort order.
> 
> But for each of these signal strength updates from ofono I'm getting
> both a ServicesChanged and PropertyChanged signal.  The ServicesChanged
> tells me both services have changed, though they obviously haven't nor
> has the sort order.  According to the API, "(the ServicesChanged) 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.
> 
> Is there a reason why this is happenning?

If only the signal strength has changed, then ServicesChanged should not
be send out. So this is clearly a bug. 

void __connman_service_update_from_network(struct connman_network *network)
{

[...]

        strength = connman_network_get_strength(service->network);
        if (strength == service->strength)
                goto roaming;

        service->strength = strength;
        need_sort = TRUE;

        strength_changed(service);

[...]

sorting:
        if (need_sort == TRUE) {
                iter = g_hash_table_lookup(service_hash, service->identifier);
                if (iter != NULL && g_sequence_get_length(service_list) > 1) {
                        g_sequence_sort_changed(iter, service_compare, NULL);
                        service_schedule_changed();
                }
        }
}

So the PropertyChanged() is triggered by strength_changed(). The ServicesChanged
is triggered by the sorting part. That code snippet works for ready/online 
services
(g_sequence_sort_changed() > 1) but not for idle ones. 

So one way to prevent the ServiceChanged signal is to consider only
connecting/connected services. Though I am not sure if that is what we need. 
I'll
send a RFC in a moment.

cheers,
daniel

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

Reply via email to