[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:
Zhanglong Xia
2022-05-24 10:47:30 -07:00
committed by GitHub
parent 349041bc61
commit 67c2c04f0e
2 changed files with 18 additions and 2 deletions
+16 -1
View File
@@ -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>
+2 -1
View File
@@ -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"