From b92862a8d4243b97de6888e00d4665441c0cd406 Mon Sep 17 00:00:00 2001 From: Durmus Koyuncu Date: Thu, 16 Jul 2026 20:30:43 +0300 Subject: [PATCH] RDKBWIFI-518: Report real device country code in EasyMesh device translation The EasyMesh device translator hardcoded the device country to "US", so the actual regulatory country never propagated to the controller and Device.WiFi.DataElements Network.Device.{i}.CountryCode could not be reported. Report the device's country from the radio config (via country_code_conversion) when building the device object, falling back to US only when it is unavailable. Signed-off-by: Durmus Koyuncu --- source/webconfig/wifi_easymesh_translator.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/webconfig/wifi_easymesh_translator.c b/source/webconfig/wifi_easymesh_translator.c index 95d6451ff..83207ca17 100644 --- a/source/webconfig/wifi_easymesh_translator.c +++ b/source/webconfig/wifi_easymesh_translator.c @@ -323,7 +323,16 @@ webconfig_error_t translate_device_object_to_easymesh_for_dml(webconfig_subdoc memcpy(device_info->backhaul_alid.mac, wifi_prop->al_1905_mac, sizeof(mac_address_t)); interfacename_from_mac((const mac_address_t *)device_info->backhaul_alid.mac,device_info->backhaul_alid.name); //proto->set_num_radio(proto->data_model, wifi_prop->numRadios); + /* Report the device's regulatory country as Network.Device.{i}.CountryCode. + Default to US, override only for an in range enum (conversion does not bounds check). */ snprintf(device_info->country_code, sizeof(device_info->country_code), "US"); + if (decoded_params->num_radios > 0) { + wifi_countrycode_type_t cc_enum = decoded_params->radios[0].oper.countryCode; + if ((unsigned int)cc_enum < MAX_WIFI_COUNTRYCODE) { + country_code_conversion(&cc_enum, device_info->country_code, + sizeof(device_info->country_code), ENUM_TO_STRING); + } + } for (unsigned int i = 0; i < decoded_params->num_radios; i++) { radio = &decoded_params->radios[i]; dfs_enable = radio->oper.DfsEnabled;