Fix network types for Bluetooth and Cellular devices
authorMarcel Holtmann <marcel@holtmann.org>
Wed, 31 Dec 2008 07:12:48 +0000 (08:12 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 31 Dec 2008 07:12:48 +0000 (08:12 +0100)
include/element.h
src/element.c
src/network.c

index afe7b0c259c23c594727c28ad92bc1095fd8433f..812ac30226c91dcdcbb8da4632efbffccb400327 100644 (file)
@@ -74,7 +74,7 @@ enum connman_element_subtype {
        CONNMAN_ELEMENT_SUBTYPE_ETHERNET  = 3,
        CONNMAN_ELEMENT_SUBTYPE_WIFI      = 4,
        CONNMAN_ELEMENT_SUBTYPE_WIMAX     = 5,
-       CONNMAN_ELEMENT_SUBTYPE_MODEM     = 6,
+       CONNMAN_ELEMENT_SUBTYPE_CELLULAR  = 6,
        CONNMAN_ELEMENT_SUBTYPE_BLUETOOTH = 7,
 };
 
index 42e4e87ee34c7111ace88d6b4594c6516fc364c0..5e795899af9c30d91c2f7e3b60e42be3442455cb 100644 (file)
@@ -138,8 +138,8 @@ static const char *subtype2string(enum connman_element_subtype type)
                return "wifi";
        case CONNMAN_ELEMENT_SUBTYPE_WIMAX:
                return "wimax";
-       case CONNMAN_ELEMENT_SUBTYPE_MODEM:
-               return "modem";
+       case CONNMAN_ELEMENT_SUBTYPE_CELLULAR:
+               return "cellular";
        case CONNMAN_ELEMENT_SUBTYPE_BLUETOOTH:
                return "bluetooth";
        }
index fe5f399e59afc95385303106d83d1558f5a417bc..de48611fc1e09c1b0858c1bc1acb06447bfd1584 100644 (file)
@@ -256,6 +256,19 @@ struct connman_network *connman_network_create(const char *identifier,
        network->element.type = CONNMAN_ELEMENT_TYPE_NETWORK;
        network->element.index = -1;
 
+       switch (type) {
+       case CONNMAN_NETWORK_TYPE_BLUETOOTH_PAN:
+       case CONNMAN_NETWORK_TYPE_BLUETOOTH_DUN:
+               network->element.subtype = CONNMAN_ELEMENT_SUBTYPE_BLUETOOTH;
+               break;
+       case CONNMAN_NETWORK_TYPE_HSO:
+               network->element.subtype = CONNMAN_ELEMENT_SUBTYPE_CELLULAR;
+               break;
+       default:
+               network->element.subtype = CONNMAN_ELEMENT_SUBTYPE_UNKNOWN;
+               break;
+       }
+
        network->element.network = network;
        network->element.destruct = network_destruct;