Clear Wifi DCT


#1

Hi,

I am using wiced_configure_device() to configure wifi cridentials. If I enter wrong password, it tries and passes to next wifi stored AP entry. I thing there is 5 of them which is defined with CONFIG_AP_LIST_SIZE.

Also tried to clear with pressing both buttons and release reset and wait for white, but led goes off after blue blink. Wifi AP entry was removed but same dirty values as described above.

Here is an example AP entry that tries to connect :

Joining : �����������������������������������������������������������������������������������������������������������������������������������������������������������������
Failed to join : ����������������������������������������������������������������������������������������������������������������������������������������������������������

How can I clear AP entries ? Also I want to be sure that will not try to connect unconfigured AP entries.

Here some other info that prints:

Starting WICED v5.0.1
Platform RB_DUO initialised
Started ThreadX v5.6
Initialising NetX_Duo v5.7_sp2
Creating Packet pools
WLAN MAC Address : XXXXXXXXXXXX
WLAN Firmware    : wl0: Apr 27 2017 03:30:42 version 7.45.98.18 (r664830) FWID 01-cb1becb6
WLAN CLM         : API: 12.2 Data: 7.11.15 Compiler: 1.24.2 ClmImport: 1.24.1 Creation: 2014-05-26 10:53:55 Inc Data: 9.10.39 Inc Compiler: 1.29.4 Inc ClmImport: 1.36.3 C 

#2

Also asked at Cypress forum : https://community.cypress.com/message/150068#150068


#3

I have made a temporary solution.

static wiced_result_t config_at_worker_thread( void * arg )
{
    platform_dct_wifi_config_t  dct_wifi_config;
    uint32_t i = 0;
    if (wiced_dct_read_with_copy( &dct_wifi_config, DCT_WIFI_CONFIG_SECTION, 0, sizeof(platform_dct_wifi_config_t) ) == WICED_SUCCESS) {
        dct_wifi_config.device_configured = WICED_FALSE;
        for(i = 0; i < CONFIG_AP_LIST_SIZE; ++i) memset(&dct_wifi_config.stored_ap_list[i], 0, sizeof(wiced_config_ap_entry_t));
        // memcpy(&dct_wifi_config.mac_address, &mac_address, sizeof(wiced_mac_t));
        // dct_wifi_config.country_code = WICED_COUNTRY_TURKEY;
        if (wiced_dct_write( &dct_wifi_config, DCT_WIFI_CONFIG_SECTION, 0, sizeof(platform_dct_wifi_config_t)) == WICED_SUCCESS) {
            const configuration_entry_t app_config[] = { {0,0,0,0} };
            r_ = wiced_configure_device( app_config );
            if (r_) GW_PRINTF("wiced_configure_device() failed! r_=%d\n", r_);
            r_ = wiced_rtos_set_event_flags(&app.events, GW_EVENT_CONFIG_FINISHED);
            if (r_) GW_PRINTF("wiced_rtos_set_event_flags(GW_EVENT_CONFIG_FINISHED) failed! r_=%d\n", r_);
        }
        else GW_PRINTF("wiced_dct_write(dct_wifi_config.device_configured=false) failed! r_=%d\n", r_);
    }
    else GW_PRINTF("wiced_dct_read(dct_wifi_config) failed! r_=%d\n", r_);
    return WICED_SUCCESS;
}