summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorArron Wang <arron.wang@intel.com>2012-09-24 14:18:07 +0800
committerZhang zhengguang <zhengguang.zhang@intel.com>2014-10-31 16:06:20 +0800
commit98894f533f23fe532a4449ddaafaa69d39441980 (patch)
tree7d8a04c01fb90ad4f7c6584ac089a63ec925e1c3 /src
parent8b828d775adb413be2e02a5377d83af9ecb979ed (diff)
downloadconnman-98894f533f23fe532a4449ddaafaa69d39441980.tar.gz
connman-98894f533f23fe532a4449ddaafaa69d39441980.tar.bz2
connman-98894f533f23fe532a4449ddaafaa69d39441980.zip
Tizen: Export more wifi info in ConnMan network API
Network client requires additional wifi specific info Export the BSSID property Export the MaxRate property Export the detailed info for encryption mode(mixed,aes,tkip,wep,none) Export the connman_network get/set method for bssid, maxrate, encryption_mode property Change-Id: Ic5744978282e49cb2f70165aaadc7822dc718dfb
Diffstat (limited to 'src')
-rw-r--r--src/network.c73
1 files changed, 73 insertions, 0 deletions
diff --git a/src/network.c b/src/network.c
index b388995f..c40a0795 100644
--- a/src/network.c
+++ b/src/network.c
@@ -41,6 +41,11 @@
*/
#define RS_REFRESH_TIMEOUT 3
+#if defined TIZEN_EXT
+#define WIFI_ENCYPTION_MODE_LEN_MAX 6
+#define WIFI_BSSID_LEN_MAX 6
+#endif
+
static GSList *network_list = NULL;
static GSList *driver_list = NULL;
@@ -87,6 +92,11 @@ struct connman_network {
bool wps;
bool use_wps;
char *pin_wps;
+#if defined TIZEN_EXT
+ char encryption_mode[WIFI_ENCYPTION_MODE_LEN_MAX];
+ unsigned char bssid[WIFI_BSSID_LEN_MAX];
+ unsigned int maxrate;
+#endif
} wifi;
};
@@ -1737,6 +1747,69 @@ int connman_network_set_ipaddress(struct connman_network *network,
return 0;
}
+#if defined TIZEN_EXT
+/*
+ * Description: Network client requires additional wifi specific info
+ */
+int connman_network_set_bssid(struct connman_network *network,
+ const unsigned char *bssid)
+{
+ int i = 0;
+
+ if (bssid == NULL)
+ return -EINVAL;
+
+ DBG("network %p bssid %02x:%02x:%02x:%02x:%02x:%02x", network,
+ bssid[0], bssid[1], bssid[2],
+ bssid[3], bssid[4], bssid[5]);
+
+ for (;i < WIFI_BSSID_LEN_MAX;i++)
+ network->wifi.bssid[i] = bssid[i];
+
+ return 0;
+}
+
+unsigned char *connman_network_get_bssid(struct connman_network *network)
+{
+ return (unsigned char *)network->wifi.bssid;
+}
+
+int connman_network_set_maxrate(struct connman_network *network,
+ unsigned int maxrate)
+{
+ DBG("network %p maxrate %d", network, maxrate);
+
+ network->wifi.maxrate = maxrate;
+
+ return 0;
+}
+
+unsigned int connman_network_get_maxrate(struct connman_network *network)
+{
+ return network->wifi.maxrate;
+}
+
+int connman_network_set_enc_mode(struct connman_network *network,
+ const char *encryption_mode)
+{
+ if (encryption_mode == NULL)
+ return -EINVAL;
+
+ DBG("network %p encryption mode %s", network, encryption_mode);
+
+ g_strlcpy(network->wifi.encryption_mode, encryption_mode,
+ WIFI_ENCYPTION_MODE_LEN_MAX);
+
+ return 0;
+}
+
+const char *connman_network_get_enc_mode(struct connman_network *network)
+{
+ return (const char *)network->wifi.encryption_mode;
+}
+
+#endif
+
int connman_network_set_nameservers(struct connman_network *network,
const char *nameservers)
{