1
0
Fork 0
forked from nuttx/nuttx-update

wifisim: Modify the connection logic based on BSSID.

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
This commit is contained in:
liqinhui 2023-12-28 15:07:18 +08:00 committed by Xiang Xiao
parent 06c1db81ff
commit c3df7c5b00

View file

@ -852,6 +852,14 @@ static int wifidriver_start_connect(FAR struct wifi_sim_s *wifidev)
memset(&wrqu, 0, sizeof(wrqu));
memcpy(wrqu.ap_addr.sa_data, bss_info->bssid, ETH_ALEN);
wifi_send_event(wifidev, SIOCGIWAP, &wrqu);
/* If connect the AP with the bssid, copy the essid from bss */
if (wifidev->ssid_flag == 2)
{
memcpy(wifidev->ssid, bss_info->ssid,
strlen(bss_info->ssid));
}
}
else
{
@ -1750,10 +1758,6 @@ static int wifidriver_bssid(FAR struct netdev_lowerhalf_s *dev,
if (set)
{
ret = wifidriver_set_bssid(wifidev, iwr);
if (ret >= 0)
{
ret = wifidriver_start_connect(wifidev);
}
}
else
{