mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 09:18:00 +08:00
xtensa/esp32s3: add wapi support for getting country code
commands on ESP32-S3
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user