Changed wifi.sta.getrssi() to allow user to request RSSI from alternate

BSSID even if bssid_set==0 in STATION config
This commit is contained in:
dnc40085 2015-05-09 20:13:53 -07:00
parent bdda245a82
commit 90e8bfd5e4
1 changed files with 13 additions and 17 deletions

View File

@ -483,8 +483,6 @@ static int wifi_station_getrssi( lua_State* L )
config.ssid = ssid;
}
if(sta_conf.bssid_set==1) // check if STATION is configured to connect to a specific AP's BSSID
{
if(lua_isstring(L, 2)) //check if user specified an alternate BSSID to check
{
char mac[6];
@ -494,13 +492,11 @@ static int wifi_station_getrssi( lua_State* L )
return luaL_error( L, "wrong arg type" );
os_str2macaddr(mac, macaddr);
config.bssid = mac;
// c_memcpy(config.bssid, mac, 6);
}
else //user did NOT specify an alternate BSSID to check
else if (sta_conf.bssid_set==1) // check if STATION is configured to connect to a specific AP's BSSID
{
config.bssid = sta_conf.bssid;
}
}
else //STATION is NOT configured to connect to a specific AP
{
config.bssid = NULL;