diff options
author | Niraj Kumar Goit <niraj.g@samsung.com> | 2019-03-29 16:05:49 +0530 |
---|---|---|
committer | Niraj Kumar Goit <niraj.g@samsung.com> | 2019-04-05 12:56:09 +0530 |
commit | 69efc565b595bb39ebdbe635f063675ecf59278c (patch) | |
tree | 33c51a4e1d04ba61a143033e32afda67cd93cf83 /src | |
parent | 85074ce75ce1749e270dc9951d003d4a3c1f9cab (diff) | |
download | connman-69efc565b595bb39ebdbe635f063675ecf59278c.tar.gz connman-69efc565b595bb39ebdbe635f063675ecf59278c.tar.bz2 connman-69efc565b595bb39ebdbe635f063675ecf59278c.zip |
Added support of Multiple same SSIDs including band steering.submit/tizen/20190409.131053accepted/tizen/unified/20190410.061801
When there are multiple APs with the same SSID and security,
this patch support below features:
1. If AP does not respond to probe request during connection
procedure, connman tries to connect with the next available BSSID
before sending disconnected event to application.
2. If connection with AP is failed during association due to
ASSOC_REJECT, connman tries to connect with the next available BSSID
before sending disconnected event to application.
Change-Id: Ie80939bd013a12b9c88e91a1fd5a05fbb57c1833
Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
Diffstat (limited to 'src')
-rwxr-xr-x | src/network.c | 28 | ||||
-rw-r--r-- | src/service.c | 36 |
2 files changed, 42 insertions, 22 deletions
diff --git a/src/network.c b/src/network.c index b7103683..9933b723 100755 --- a/src/network.c +++ b/src/network.c @@ -41,11 +41,6 @@ */ #define RS_REFRESH_TIMEOUT 3 -#if defined TIZEN_EXT -#define WIFI_ENCYPTION_MODE_LEN_MAX 6 -#define WIFI_BSSID_LEN_MAX 6 -#endif - /* * As per RFC 4861, a host should transmit up to MAX_RTR_SOLICITATIONS(3) * Router Solicitation messages, each separated by at least @@ -107,6 +102,7 @@ struct connman_network { #if defined TIZEN_EXT char encryption_mode[WIFI_ENCYPTION_MODE_LEN_MAX]; unsigned char bssid[WIFI_BSSID_LEN_MAX]; + char last_bssid[MAC_ADDRESS_LENGTH]; unsigned int maxrate; int maxspeed; bool isHS20AP; @@ -1584,6 +1580,11 @@ int connman_network_set_connected(struct connman_network *network, network, network->connected, connected, network->connecting, network->associating); +#if defined TIZEN_EXT + /* reset last connect request bssid */ + connman_network_set_last_bssid(network, NULL); +#endif + if ((network->connecting || network->associating) && !connected) { connman_network_set_error(network, @@ -1975,6 +1976,23 @@ unsigned char *connman_network_get_bssid(struct connman_network *network) return (unsigned char *)network->wifi.bssid; } +int connman_network_set_last_bssid(struct connman_network *network, + const char *bssid) +{ + if (bssid == NULL) { + memset(network->wifi.last_bssid, '\0', sizeof(network->wifi.last_bssid)); + return -EINVAL; + } + strncpy(network->wifi.last_bssid, bssid, MAC_ADDRESS_LENGTH - 1); + + return 0; +} + +char *connman_network_get_last_bssid(struct connman_network *network) +{ + return (char *)network->wifi.last_bssid; +} + int connman_network_set_maxspeed(struct connman_network *network, int maxspeed) { diff --git a/src/service.c b/src/service.c index 777db8f5..2fd1e50e 100644 --- a/src/service.c +++ b/src/service.c @@ -3342,29 +3342,31 @@ static void append_wifi_ext_info(DBusMessageIter *dict, static void append_bssid_info(DBusMessageIter *iter, void *user_data) { - GSList *bssid_list = NULL; + GSList *bssid_list = NULL; struct connman_network *network = user_data; - struct connman_bssids *bssids; - char bssid_buf[18] = {0,}; - char *bssid_str = bssid_buf; + struct connman_bssids *bssids; + char bssid_buf[MAC_ADDRESS_LENGTH] = {0,}; + char *bssid_str = bssid_buf; - bssid_list = (GSList *)connman_network_get_bssid_list(network); - if(bssid_list) { - GSList *list; - for (list = bssid_list; list; list = list->next) { - bssids = (struct connman_bssids *)list->data; - memcpy(bssid_str, bssids->bssid, 18); + bssid_list = (GSList *)connman_network_get_bssid_list(network); + if(bssid_list) { + GSList *list; + for (list = bssid_list; list; list = list->next) { + bssids = (struct connman_bssids *)list->data; + g_snprintf(bssid_buf, MAC_ADDRESS_LENGTH, "%02x:%02x:%02x:%02x:%02x:%02x", + bssids->bssid[0], bssids->bssid[1], bssids->bssid[2], + bssids->bssid[3], bssids->bssid[4], bssids->bssid[5]); connman_dbus_dict_append_basic(iter, "BSSID", - DBUS_TYPE_STRING, &bssid_str); + DBUS_TYPE_STRING, &bssid_str); - connman_dbus_dict_append_basic(iter, "Strength", - DBUS_TYPE_UINT16, &bssids->strength); + connman_dbus_dict_append_basic(iter, "Strength", + DBUS_TYPE_UINT16, &bssids->strength); - connman_dbus_dict_append_basic(iter, "Frequency", - DBUS_TYPE_UINT16, &bssids->frequency); - } - } + connman_dbus_dict_append_basic(iter, "Frequency", + DBUS_TYPE_UINT16, &bssids->frequency); + } + } } #endif |