mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 10:58:49 +08:00
xtensa/esp32s3: add wapi support for getting country code
commands on ESP32-S3
This commit is contained in:
parent
41c4e3a5a1
commit
9308675686
2 changed files with 13 additions and 1 deletions
|
@ -5884,7 +5884,15 @@ int esp_wifi_sta_country(struct iwreq *iwr, bool set)
|
|||
}
|
||||
else
|
||||
{
|
||||
return -ENOSYS;
|
||||
memset(&country, 0x00, sizeof(wifi_country_t));
|
||||
ret = esp_wifi_get_country(&country);
|
||||
if (ret)
|
||||
{
|
||||
wlerr("Failed to get country info ret=%d\n", ret);
|
||||
return wifi_errno_trans(ret);
|
||||
}
|
||||
|
||||
memcpy(iwr->u.data.pointer, country.cc, 2);
|
||||
}
|
||||
|
||||
return OK;
|
||||
|
|
|
@ -1377,6 +1377,10 @@ static int wlan_ioctl(struct net_driver_s *dev,
|
|||
ret = ops->country(iwr, true);
|
||||
break;
|
||||
|
||||
case SIOCGIWCOUNTRY: /* Set country code */
|
||||
ret = ops->country(iwr, false);
|
||||
break;
|
||||
|
||||
case SIOCGIWSENS: /* Get sensitivity (dBm) */
|
||||
ret = ops->rssi(iwr, false);
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue