summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArron Wang <arron.wang@intel.com>2012-09-24 14:42:02 +0800
committerZhang zhengguang <zhengguang.zhang@intel.com>2014-07-31 15:51:57 +0800
commitec9e99016e00c06a25ed3af5a5d4cf3d20383739 (patch)
tree467526fc9408b39c5660c99f6dc4e6078f010fe2
parent1b16b3d9ece01d219ab3830f13d5a282f97d7dc9 (diff)
downloadconnman-ec9e99016e00c06a25ed3af5a5d4cf3d20383739.tar.gz
connman-ec9e99016e00c06a25ed3af5a5d4cf3d20383739.tar.bz2
connman-ec9e99016e00c06a25ed3af5a5d4cf3d20383739.zip
Tizen: Append extra wifi service property
Append wifi property bssid, maxrate, frequency, encryptionmode to wifi service Change-Id: I1d5987334ab288fc04ff931fda5108f4afe864f0
-rw-r--r--doc/service-api.txt26
-rw-r--r--src/service.c43
2 files changed, 69 insertions, 0 deletions
diff --git a/doc/service-api.txt b/doc/service-api.txt
index c9dd7e2f..74c83456 100644
--- a/doc/service-api.txt
+++ b/doc/service-api.txt
@@ -191,6 +191,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 cbca669e..e8c9224d 100644
--- a/src/service.c
+++ b/src/service.c
@@ -39,6 +39,10 @@
#define CONNECT_TIMEOUT 120
+#if defined TIZEN_EXT
+#define WIFI_BSSID_STR_LEN 18
+#endif
+
static DBusConnection *connection = NULL;
static GList *service_list = NULL;
@@ -2264,6 +2268,37 @@ int __connman_service_iterate_services(service_iterate_cb cb, void *user_data)
return 0;
}
+#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)
{
@@ -2329,6 +2364,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:
case CONNMAN_SERVICE_TYPE_GADGET: