From 98894f533f23fe532a4449ddaafaa69d39441980 Mon Sep 17 00:00:00 2001 From: Arron Wang Date: Mon, 24 Sep 2012 14:18:07 +0800 Subject: 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 --- src/network.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) (limited to 'src/network.c') 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) { -- cgit v1.2.3