From d482ccc485f98416b0df5bbcad97110bc390c35c Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 31 Dec 2008 08:12:48 +0100 Subject: [PATCH] Fix network types for Bluetooth and Cellular devices --- include/element.h | 2 +- src/element.c | 4 ++-- src/network.c | 13 +++++++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/include/element.h b/include/element.h index afe7b0c2..812ac302 100644 --- a/include/element.h +++ b/include/element.h @@ -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, }; diff --git a/src/element.c b/src/element.c index 42e4e87e..5e795899 100644 --- a/src/element.c +++ b/src/element.c @@ -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"; } diff --git a/src/network.c b/src/network.c index fe5f399e..de48611f 100644 --- a/src/network.c +++ b/src/network.c @@ -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; -- 2.34.1