Fix notification to use service types instead of device types
authorMarcel Holtmann <marcel@holtmann.org>
Thu, 23 Jul 2009 22:44:08 +0000 (00:44 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 23 Jul 2009 22:44:08 +0000 (00:44 +0200)
include/notifier.h
include/service.h
plugins/iospm.c
src/notifier.c

index fdbc1b9d2295129c29c4ec0de2128fc2164053a6..1addb556059cd8f8af8cf8e50d2bd93de56ebaf8 100644 (file)
@@ -22,7 +22,7 @@
 #ifndef __CONNMAN_NOTIFIER_H
 #define __CONNMAN_NOTIFIER_H
 
-#include <connman/device.h>
+#include <connman/service.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -41,7 +41,7 @@ extern "C" {
 struct connman_notifier {
        const char *name;
        int priority;
-       void (*device_enabled) (enum connman_device_type type,
+       void (*service_enabled) (enum connman_service_type type,
                                                connman_bool_t enabled);
        void (*offline_mode) (connman_bool_t enabled);
 };
index 6138f2cd3871d6d2b0aa89b2ec5c718eb0262946..b19a531fba723dbcc76d73e5be93251e9ff1d627 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef __CONNMAN_SERVICE_H
 #define __CONNMAN_SERVICE_H
 
+#include <connman/types.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
index e64436997d4a3100779e99d9caf6ca27da2122bb..02e532ed6865a70b583c70b0e0a1a1abe7eeaaf4 100644 (file)
@@ -61,23 +61,17 @@ static void send_indication(const char *path, connman_bool_t enabled)
        dbus_message_unref(message);
 }
 
-static void iospm_device_enabled(enum connman_device_type type,
+static void iospm_service_enabled(enum connman_service_type type,
                                                connman_bool_t enabled)
 {
        switch (type) {
-       case CONNMAN_DEVICE_TYPE_UNKNOWN:
-       case CONNMAN_DEVICE_TYPE_VENDOR:
-       case CONNMAN_DEVICE_TYPE_ETHERNET:
-       case CONNMAN_DEVICE_TYPE_WIFI:
-       case CONNMAN_DEVICE_TYPE_WIMAX:
-       case CONNMAN_DEVICE_TYPE_GPS:
-       case CONNMAN_DEVICE_TYPE_MBM:
-       case CONNMAN_DEVICE_TYPE_HSO:
-       case CONNMAN_DEVICE_TYPE_NOZOMI:
-       case CONNMAN_DEVICE_TYPE_HUAWEI:
-       case CONNMAN_DEVICE_TYPE_NOVATEL:
+       case CONNMAN_SERVICE_TYPE_UNKNOWN:
+       case CONNMAN_SERVICE_TYPE_ETHERNET:
+       case CONNMAN_SERVICE_TYPE_WIFI:
+       case CONNMAN_SERVICE_TYPE_WIMAX:
+       case CONNMAN_SERVICE_TYPE_CELLULAR:
                break;
-       case CONNMAN_DEVICE_TYPE_BLUETOOTH:
+       case CONNMAN_SERVICE_TYPE_BLUETOOTH:
                send_indication(IOSPM_BLUETOOTH, enabled);
                break;
        }
@@ -91,7 +85,7 @@ static void iospm_offline_mode(connman_bool_t enabled)
 static struct connman_notifier iospm_notifier = {
        .name           = "iospm",
        .priority       = CONNMAN_NOTIFIER_PRIORITY_DEFAULT,
-       .device_enabled = iospm_device_enabled,
+       .service_enabled= iospm_service_enabled,
        .offline_mode   = iospm_offline_mode,
 };
 
index cfd675025e19c8868b0a54198e4146d21485c221..2403e91927048c4adb9d3a4005eff59c7010fb8d 100644 (file)
@@ -176,7 +176,7 @@ static void technology_registered(enum connman_service_type type,
        g_dbus_send_message(connection, signal);
 }
 
-static void technology_enabled(enum connman_device_type type,
+static void technology_enabled(enum connman_service_type type,
                                                connman_bool_t enabled)
 {
        GSList *list;
@@ -212,8 +212,8 @@ done:
        for (list = notifier_list; list; list = list->next) {
                struct connman_notifier *notifier = list->data;
 
-               if (notifier->device_enabled)
-                       notifier->device_enabled(type, enabled);
+               if (notifier->service_enabled)
+                       notifier->service_enabled(type, enabled);
        }
 }