Switching from STA Mode to AP mode

  1. My goal is: To switch from STA mode to AP mode using C language code
  2. My actions are: I am successfully adding the getters and setters
  3. The result I see is: I can able to get the STA and AP mode to enable values(0/1) from the mos.yml file
  4. My expectation & question is: I cannot set Enable as Zero(0)/One(1)

Can anyone please suggest me how to achieve it using the C language, Here is my code:

if (connectionStatus == MGOS_WIFI_DISCONNECTED)

    {

        // I am sucessfully getting the enable values

        mgos_sys_config_get_wifi_ap_enable());  

        mgos_sys_config_get_wifi_sta_enable();

        // I set the following 

        mgos_sys_config_set_wifi_ap_enable(1);

        mgos_sys_config_set_wifi_sta_enable(0);

    }

I can flash the code but my device is not switching from STA to AP mode
please kindly help me to achieve it.

Thanks and regards
C J Lokesh

You need to initialize WiFi after changing config.
Search this forum, there are posts regarding how to do that from not very long ago.