nRF7002DK, Set region return no error on wrong country code but after 10s

Parents
  • Hi,

     

    I added this function to the wifi/sta sample, and called it just after net_mgmt_callback_init() in main() function:

    static int wifi_set_reg(void)
    {
    	struct net_if *iface;
    	struct wifi_reg_domain reg = { 0 };
    	int ret;
    
    	reg.oper = WIFI_MGMT_SET;
    	uint8_t low = 'X'; uint8_t high = 'Y';
    	iface = net_if_get_first_wifi();
    	if (iface == NULL) {
    		LOG_ERR("No Wi-Fi interface found");
    		return -1;
    	}
    
    	reg.country_code[0] = low;
    	reg.country_code[1] = high;
    	reg.force = false;
    
    	ret = net_mgmt(NET_REQUEST_WIFI_REG_DOMAIN, iface, &reg, sizeof(reg));
    	if (ret) {
    		LOG_ERR("Regulatory setting failed %d", ret);
    		return -1;
    	}
    
    	printk("Regulatory set to %c%c for interface %d\n", reg.country_code[0],
    		reg.country_code[1], net_if_get_by_iface(iface));
    
    	return 0;
    }
    
    int main(void)
    {
    	int ret = 0;
    
    	net_mgmt_callback_init();
    	wifi_set_reg();
    	....

     

    And the output is as follows:

    00:00:11.840,270] <err> wifi_nrf: nrf_wifi_fmac_set_reg: Failed to set regulatory information
    [00:00:11.840,301] <err> wifi_nrf: nrf_wifi_supp_set_country: nrf_wifi_fmac_set_reg failed
    [00:00:11.840,362] <err> wpa_supp: wpa_drv_zep_set_country: set_country op failed
    [00:00:11.840,454] <err> wpa_supp: Failed to set country code 'XY'
    Regulatory set to XY for interface 1

     

    meaning that net_mgmt() returns 0 (success) in this scenario, and uses 10 seconds to return.

    Clear bugs from our side, which I will report internally. Thank you so much for notifying us and helping us improve our delivery!

     

    Kind regards,

    Håkon

Reply
  • Hi,

     

    I added this function to the wifi/sta sample, and called it just after net_mgmt_callback_init() in main() function:

    static int wifi_set_reg(void)
    {
    	struct net_if *iface;
    	struct wifi_reg_domain reg = { 0 };
    	int ret;
    
    	reg.oper = WIFI_MGMT_SET;
    	uint8_t low = 'X'; uint8_t high = 'Y';
    	iface = net_if_get_first_wifi();
    	if (iface == NULL) {
    		LOG_ERR("No Wi-Fi interface found");
    		return -1;
    	}
    
    	reg.country_code[0] = low;
    	reg.country_code[1] = high;
    	reg.force = false;
    
    	ret = net_mgmt(NET_REQUEST_WIFI_REG_DOMAIN, iface, &reg, sizeof(reg));
    	if (ret) {
    		LOG_ERR("Regulatory setting failed %d", ret);
    		return -1;
    	}
    
    	printk("Regulatory set to %c%c for interface %d\n", reg.country_code[0],
    		reg.country_code[1], net_if_get_by_iface(iface));
    
    	return 0;
    }
    
    int main(void)
    {
    	int ret = 0;
    
    	net_mgmt_callback_init();
    	wifi_set_reg();
    	....

     

    And the output is as follows:

    00:00:11.840,270] <err> wifi_nrf: nrf_wifi_fmac_set_reg: Failed to set regulatory information
    [00:00:11.840,301] <err> wifi_nrf: nrf_wifi_supp_set_country: nrf_wifi_fmac_set_reg failed
    [00:00:11.840,362] <err> wpa_supp: wpa_drv_zep_set_country: set_country op failed
    [00:00:11.840,454] <err> wpa_supp: Failed to set country code 'XY'
    Regulatory set to XY for interface 1

     

    meaning that net_mgmt() returns 0 (success) in this scenario, and uses 10 seconds to return.

    Clear bugs from our side, which I will report internally. Thank you so much for notifying us and helping us improve our delivery!

     

    Kind regards,

    Håkon

Children
No Data
Related