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-10-31 16:06:20 +0800
commitd9c8d2e9c9b3d0b7c8c884e74b124895a627d148 (patch)
tree4f0e953e3aec22a7ab7334eba664df14fdd795ac
parent98894f533f23fe532a4449ddaafaa69d39441980 (diff)
downloadconnman-d9c8d2e9c9b3d0b7c8c884e74b124895a627d148.tar.gz
connman-d9c8d2e9c9b3d0b7c8c884e74b124895a627d148.tar.bz2
connman-d9c8d2e9c9b3d0b7c8c884e74b124895a627d148.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 87a2f2cd..d3b219fe 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;
@@ -2252,6 +2256,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)
{
@@ -2317,6 +2352,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: