From dd5db19baeec6c4d586b23cd590cce53bfea044d Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 11 Mar 2009 21:10:13 +0100 Subject: [PATCH] Add type for GPS based devices (just for power control) --- include/device.h | 1 + src/detect.c | 2 ++ src/device.c | 8 ++++++++ 3 files changed, 11 insertions(+) diff --git a/include/device.h b/include/device.h index 0f30100..e4a735f 100644 --- a/include/device.h +++ b/include/device.h @@ -41,6 +41,7 @@ enum connman_device_type { CONNMAN_DEVICE_TYPE_WIFI = 2, CONNMAN_DEVICE_TYPE_WIMAX = 3, CONNMAN_DEVICE_TYPE_BLUETOOTH = 4, + CONNMAN_DEVICE_TYPE_GPS = 5, CONNMAN_DEVICE_TYPE_HSO = 15, CONNMAN_DEVICE_TYPE_NOZOMI = 16, CONNMAN_DEVICE_TYPE_HUAWEI = 17, diff --git a/src/detect.c b/src/detect.c index 01e67b1..d26dc29 100644 --- a/src/detect.c +++ b/src/detect.c @@ -189,6 +189,7 @@ static void detect_newlink(unsigned short type, int index, name = index2ident(index, "dev_"); break; case CONNMAN_DEVICE_TYPE_BLUETOOTH: + case CONNMAN_DEVICE_TYPE_GPS: case CONNMAN_DEVICE_TYPE_HSO: case CONNMAN_DEVICE_TYPE_NOZOMI: case CONNMAN_DEVICE_TYPE_HUAWEI: @@ -211,6 +212,7 @@ static void detect_newlink(unsigned short type, int index, case CONNMAN_DEVICE_TYPE_NOZOMI: case CONNMAN_DEVICE_TYPE_HUAWEI: case CONNMAN_DEVICE_TYPE_NOVATEL: + case CONNMAN_DEVICE_TYPE_GPS: mode = CONNMAN_DEVICE_MODE_UNKNOWN; break; case CONNMAN_DEVICE_TYPE_ETHERNET: diff --git a/src/device.c b/src/device.c index 93a076f..a07726a 100644 --- a/src/device.c +++ b/src/device.c @@ -88,6 +88,8 @@ static const char *type2description(enum connman_device_type type) return "WiMAX"; case CONNMAN_DEVICE_TYPE_BLUETOOTH: return "Bluetooth"; + case CONNMAN_DEVICE_TYPE_GPS: + return "GPS"; case CONNMAN_DEVICE_TYPE_HSO: case CONNMAN_DEVICE_TYPE_NOZOMI: case CONNMAN_DEVICE_TYPE_HUAWEI: @@ -112,6 +114,8 @@ static const char *type2string(enum connman_device_type type) return "wimax"; case CONNMAN_DEVICE_TYPE_BLUETOOTH: return "bluetooth"; + case CONNMAN_DEVICE_TYPE_GPS: + return "gps"; case CONNMAN_DEVICE_TYPE_HSO: case CONNMAN_DEVICE_TYPE_HUAWEI: case CONNMAN_DEVICE_TYPE_NOZOMI: @@ -863,6 +867,10 @@ struct connman_device *connman_device_create(const char *node, device->priority = 50; device->scan_interval = 0; break; + case CONNMAN_DEVICE_TYPE_GPS: + device->priority = 0; + device->scan_interval = 0; + break; case CONNMAN_DEVICE_TYPE_HSO: case CONNMAN_DEVICE_TYPE_NOZOMI: case CONNMAN_DEVICE_TYPE_HUAWEI: -- 2.7.4