delete an station record

SpenZerX
Posts: 41
Joined: Thu Apr 16, 2015 9:30 pm
Location: Germany
Contact:

delete an station record

Postby SpenZerX » Sun Jul 03, 2016 8:21 am

Hi,
my code should use 5 slots for station storage. Is it ok to set this number in user init ? Or is it default?

(wifi_station_ap_number_set(5); )


Is there a function to delete or empty an unwanted station record in the array? (if customer wants to reduce from 5 stored stations to 2)? Or should i manipulate the struct station_info ?

pratik

Re: delete an station record

Postby pratik » Sun Jul 03, 2016 3:10 pm

Hello SpenZerX,

You may set the number in user_init. It seems to work just fine. The default should be 5, but it is a good idea to make sure it actually is 5, since it is stored in flash and depends on the configuration data stored in there. A previous session might have changed that!

wifi_station_get_ap_info () will return the number of stored APs. If your want that your program stores only 2 APs... you can simply retrieve all stored APs using the function wifi_station_get_ap_info () and then ignore 3 records. :)

Altering the internal structures is not recommended because the SDK functions and structures are interdependent or may change in future releases. If you alter the structures, it will be very difficult to find bugs or may cause memory leaks as well. So just ignore the records you do not want to consider.
Hope it helps!

SpenZerX
Posts: 41
Joined: Thu Apr 16, 2015 9:30 pm
Location: Germany
Contact:

Re: delete an station record

Postby SpenZerX » Sun Jul 03, 2016 7:55 pm

Hello,

thanks for your reply.

This means:
- fresh flashed SDK starts without Station records - thats my observation
- Station record 1 is added and used by user if he connects to new station
- Station record 2 is added and used by user if he connects to new station
- Station record 3 is added and used by user if he connects to new station
- today user decides to use slot 1 - by SDK function this is possible OK
next day he adds further Stations
- Station record 4? is added and used by user if he now connects to new station (coming from record 1)
- Station record 5 is added and used by user if he connects to new station
- Station record 5(6) is added - (oldest?) one is overwritten, all other shifted. He is now on record 5.(or 1?)

Now he wants to sell his device - it is not possible to delete one/all/selected station record including the passwords by SDK?

My observation is that reducing the number of station records to 1 by function wifi_station_ap_number_set(1); will NOT delete the information in the other station records.

pratik

Re: delete an station record

Postby pratik » Mon Jul 04, 2016 3:27 pm

Hello SpenZerX,

The internal SDK functions simply ignore the older saved APs when you change and reduce the number from 5 to suppose, 2 APs.
In that case the previous 3 APs are still in memory (flash) and have not been erased.

If this causes a security risk for you, you may delete ALL the records by issuing a system_restore() and then initiating a system_restart(), which will clear the information you are concerned about. Please refer to the API documentation for exact details.

Who is online

Users browsing this forum: No registered users and 288 guests