2 Replies Latest reply on May 18, 2016 1:42 PM by david_epperly_2098041

    Is there a way to dynamically add AP's  to the DCT?

    david_epperly_2098041

      Is there a way to dynamically add AP's  to the DCT?

       

      I want to do this at run time from a list that is obtained at runtime.

        • 1. Re: Is there a way to dynamically add AP's  to the DCT?
          jayi

          Hello David,

           

          Yes, you can dynamically add APs to the DCT, as in the following code in SDK\libraries\utilities\command_console\wifi\command_console_wifi.c.

           

          You can test this by building and downloading test.console to your WICED board. Type in help in the terminal and it will give you a list of commands. The "join" command will let you type in the AP SSID, password, security type and it will store the info into the DCT.

           

          To store multiple AP information you will have to extend the DCT either statically or store the AP information in the application section of the DCT. Then you could use your application to read this information and join the specific AP of your choice.

           

          I hope this helps.

           

          Thanks,

          Jaeyoung

           

              /* Read config */

              wiced_dct_read_lock( (void**) &dct_wifi_config, WICED_TRUE, DCT_WIFI_CONFIG_SECTION, 0, sizeof(platform_dct_wifi_config_t) );

           

           

              /* Modify config */

              dct_wifi_config->stored_ap_list[0].details.SSID.length = strlen( ssid );

              strncpy((char*)dct_wifi_config->stored_ap_list[0].details.SSID.value, ssid, MAX_SSID_LEN);

              dct_wifi_config->stored_ap_list[0].details.security = auth_type;

              if ( ( auth_type & ENTERPRISE_ENABLED ) == 0 )

              {

                  /* Save credentials for non-enterprise AP */

                  memcpy((char*)dct_wifi_config->stored_ap_list[0].security_key, (char*)key, MAX_PASSPHRASE_LEN);

                  dct_wifi_config->stored_ap_list[0].security_key_length = key_length;

              }

           

           

              /* Write config */

              wiced_dct_write( (const void*) dct_wifi_config, DCT_WIFI_CONFIG_SECTION, 0, sizeof(platform_dct_wifi_config_t) );

          • 2. Re: Is there a way to dynamically add AP's  to the DCT?
            david_epperly_2098041

            I ended up choosing to store the info in the application DCT area using DEFINE_APP_DCT and manage it myself, perhaps I'll change to this approach later.