connman_bool_t enabled);
void (*offline_mode) (connman_bool_t enabled);
void (*proxy_changed) (struct connman_service *service);
+ void (*service_state_changed) (struct connman_service *service,
+ enum connman_service_state state);
};
int connman_notifier_register(struct connman_notifier *notifier);
void __connman_notifier_offlinemode(connman_bool_t enabled);
void __connman_notifier_default_changed(struct connman_service *service);
void __connman_notifier_proxy_changed(struct connman_service *service);
+void __connman_notifier_service_state_changed(struct connman_service *service,
+ enum connman_service_state state);
connman_bool_t __connman_notifier_is_registered(enum connman_service_type type);
connman_bool_t __connman_notifier_is_enabled(enum connman_service_type type);
}
}
+void __connman_notifier_service_state_changed(struct connman_service *service,
+ enum connman_service_state state)
+{
+ GSList *list;
+
+ for (list = notifier_list; list; list = list->next) {
+ struct connman_notifier *notifier = list->data;
+
+ if (notifier->service_state_changed)
+ notifier->service_state_changed(service, state);
+ }
+}
+
static connman_bool_t technology_supported(enum connman_service_type type)
{
switch (type) {
static void state_changed(struct connman_service *service)
{
+ enum connman_service_state state;
const char *str;
- str = state2string(combine_state(service->state_ipv4,
- service->state_ipv6));
+ state = combine_state(service->state_ipv4, service->state_ipv6);
+
+ __connman_notifier_service_state_changed(service, state);
+
+ str = state2string(state);
if (str == NULL)
return;