4 Replies Latest reply on Sep 9, 2014 9:15 PM by grga
      • 1. Re: Storing and setting ssid/passphrase information in sdk 3.0.1
        bshaya

        It appears that the new method is to use

         

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

         

        to get a pointer to the flash file, directly write, and then call

         

        wiced_dct_read_unlock( wifi_config, WICED_TRUE ) to release it.

        • 2. Re: Storing and setting ssid/passphrase information in sdk 3.0.1
          bshaya

          This isn't actually working for me.  After attempting to configure a new SSID and passphrase, it appears that the dict hasn't changed; I just get:

          Joining : YOUR_AP_SSID

          Failed to join: YOUR_AP_SSID

           

          My code is:

           

                      if (wiced_dct_read_lock( (void**) &wifi_config, WICED_TRUE, DCT_WIFI_CONFIG_SECTION, 0, sizeof(platform_dct_wifi_config_t) ) == WICED_SUCCESS)

                      {

                          WPRINT_APP_INFO(("read dct\n"));

                          strncpy((char*)&wifi_config_dct_local.stored_ap_list[0].details.SSID.val, info.pointer1, MAX_SSID_LEN);

                          wifi_config_dct_local.stored_ap_list[0].details.security = new_security_type;

                          memcpy((char*)wifi_config_dct_local.stored_ap_list[0].security_key, new_ssid, MAX_PASSPHRASE_LEN);

                          wifi_config_dct_local.stored_ap_list[0].security_key_length = strlen(new_security_key);

                          if(wiced_dct_read_unlock( wifi_config, WICED_TRUE ) == WICED_SUCCESS){

                               wiced_init();

                              WPRINT_APP_INFO(("new credentials configured\n"));

                          }else{

                              WPRINT_APP_INFO(("credential config failed\n"));

                          }

                      }

          • 3. Re: Storing and setting ssid/passphrase information in sdk 3.0.1
            grga

            Capture.JPGHave a look at this function:wifi_join() in apps/test/console/wifi/


            int wifi_join(char* ssid, wiced_security_t auth_type, uint8_t* key, uint16_t key_length, char* ip, char* netmask, char* gateway)


            • 4. Re: Storing and setting ssid/passphrase information in sdk 3.0.1
              grga

              Is this still an issue for you? Also, we have a new SDK WICED SDK 3.1.0