diff options
author | Arron Wang <arron.wang@intel.com> | 2012-09-24 14:42:02 +0800 |
---|---|---|
committer | Zhang zhengguang <zhengguang.zhang@intel.com> | 2013-07-01 11:04:19 +0800 |
commit | a5eded6f3a9cff14ab19ee696ce27cedd633cca3 (patch) | |
tree | 65a48b894a3e4b118bfbc6b8e7ead83b03e4aa0a | |
parent | 0b571435f46d1c2acbe154c43d2e2b28403694c2 (diff) | |
download | connman-a5eded6f3a9cff14ab19ee696ce27cedd633cca3.tar.gz connman-a5eded6f3a9cff14ab19ee696ce27cedd633cca3.tar.bz2 connman-a5eded6f3a9cff14ab19ee696ce27cedd633cca3.zip |
Tizen: Append extra wifi service property
Append wifi property bssid, maxrate, frequency, encryptionmode to wifi
service
-rw-r--r-- | doc/service-api.txt | 26 | ||||
-rw-r--r-- | src/service.c | 42 |
2 files changed, 68 insertions, 0 deletions
diff --git a/doc/service-api.txt b/doc/service-api.txt index 54b77a4b..4fe6b32d 100644 --- a/doc/service-api.txt +++ b/doc/service-api.txt @@ -176,6 +176,32 @@ Properties string State [readonly] This property might be only present for WiFi services. + string BSSID [readonly] + + If the service type is WiFi, then this property + indicates the BSSID of the service. + + uint32 MaxRate [readonly] + + If the service type is WiFi, then this property + indicates the Maximum speed(bps) of the service. + + uint16 Frequency [readonly] + + If the service type is WiFi, then this property + indicates the frequency band(MHz) of the service. + + string EncryptionMode [readonly] + + If the service type is WiFi, then this property + indicates the key encryption mode. + + Possible values are "none", "wep", "tkip", "aes" + and "mixed". + + This property might be only present for WiFi + services. + uint8 Strength [readonly] Indicates the signal strength of the service. This diff --git a/src/service.c b/src/service.c index af8bfcee..24e9562a 100644 --- a/src/service.c +++ b/src/service.c @@ -39,6 +39,9 @@ #define CONNECT_TIMEOUT 120 +#if defined TIZEN_EXT +#define WIFI_BSSID_STR_LEN 18 +#endif static DBusConnection *connection = NULL; static GSequence *service_list = NULL; @@ -2178,6 +2181,37 @@ connman_bool_t __connman_service_session_dec(struct connman_service *service) return TRUE; } +#if defined TIZEN_EXT +static void append_wifi_ext_info(DBusMessageIter *dict, + struct connman_network *network) +{ + char bssid_buff[WIFI_BSSID_STR_LEN] = {0,}; + char *bssid_str = bssid_buff; + unsigned char *bssid; + unsigned int maxrate; + uint16_t frequency; + const char *enc_mode; + + bssid = connman_network_get_bssid(network); + maxrate = connman_network_get_maxrate(network); + frequency = connman_network_get_frequency(network); + enc_mode = connman_network_get_enc_mode(network); + + snprintf(bssid_str, WIFI_BSSID_STR_LEN, "%02x:%02x:%02x:%02x:%02x:%02x", + bssid[0], bssid[1], bssid[2], + bssid[3], bssid[4], bssid[5]); + + connman_dbus_dict_append_basic(dict, "BSSID", + DBUS_TYPE_STRING, &bssid_str); + connman_dbus_dict_append_basic(dict, "MaxRate", + DBUS_TYPE_UINT32, &maxrate); + connman_dbus_dict_append_basic(dict, "Frequency", + DBUS_TYPE_UINT16, &frequency); + connman_dbus_dict_append_basic(dict, "EncryptionMode", + DBUS_TYPE_STRING, &enc_mode); +} +#endif + static void append_properties(DBusMessageIter *dict, dbus_bool_t limited, struct connman_service *service) { @@ -2238,6 +2272,14 @@ static void append_properties(DBusMessageIter *dict, dbus_bool_t limited, append_ethernet, service); break; case CONNMAN_SERVICE_TYPE_WIFI: +#if defined TIZEN_EXT + if (service->network != NULL) + append_wifi_ext_info(dict, service->network); + + connman_dbus_dict_append_dict(dict, "Ethernet", + append_ethernet, service); + break; +#endif case CONNMAN_SERVICE_TYPE_ETHERNET: case CONNMAN_SERVICE_TYPE_BLUETOOTH: connman_dbus_dict_append_dict(dict, "Ethernet", |