mirror of
https://github.com/espressif/openthread.git
synced 2026-08-19 17:09:51 +00:00
[log] add region code log (#7740)
This commit adds log to record the region code to help developers know which region code is currently in use from log.
This commit is contained in:
@@ -2409,7 +2409,22 @@ exit:
|
||||
template <typename InterfaceType, typename ProcessContextType>
|
||||
otError RadioSpinel<InterfaceType, ProcessContextType>::SetRadioRegion(uint16_t aRegionCode)
|
||||
{
|
||||
return Set(SPINEL_PROP_PHY_REGION_CODE, SPINEL_DATATYPE_UINT16_S, aRegionCode);
|
||||
otError error;
|
||||
|
||||
error = Set(SPINEL_PROP_PHY_REGION_CODE, SPINEL_DATATYPE_UINT16_S, aRegionCode);
|
||||
|
||||
if (error == OT_ERROR_NONE)
|
||||
{
|
||||
otLogNotePlat("Set region code \"%c%c\" successfully", static_cast<char>(aRegionCode >> 8),
|
||||
static_cast<char>(aRegionCode));
|
||||
}
|
||||
else
|
||||
{
|
||||
otLogWarnPlat("Failed to set region code \"%c%c\": %s", static_cast<char>(aRegionCode >> 8),
|
||||
static_cast<char>(aRegionCode), otThreadErrorToString(error));
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
template <typename InterfaceType, typename ProcessContextType>
|
||||
|
||||
@@ -89,7 +89,8 @@ const char *otSysGetRadioUrlHelpString(void)
|
||||
#endif
|
||||
|
||||
return "RadioURL:\n" OT_RADIO_URL_HELP_BUS OT_RADIO_URL_HELP_MAX_POWER_TABLE
|
||||
" region[=region-code] Set the radio's region code.\n"
|
||||
" region[=region-code] Set the radio's region code. The region code must be an\n"
|
||||
" ISO 3166 alpha-2 code.\n"
|
||||
" cca-threshold[=dbm] Set the radio's CCA ED threshold in dBm measured at antenna connector.\n"
|
||||
" enable-coex[=1|0] If not specified, RCP coex operates with its default configuration.\n"
|
||||
" Disable coex with 0, and enable it with other values.\n"
|
||||
|
||||
Reference in New Issue
Block a user