B4R Question ESP12F - Newbie question concerning bytes to string manipulation and EEPROM

NoNickName

Member
Licensed User
Sorry if this question has been previously asked. I tried to search the forum, got a number of hits, but was unable to identify anything working for me.
This is the scenario: the user saves SSID and pwd, among other data, in the EEPROM.
Other data have fixed length, so it is easy to retrieve the exact value of string or int.
SSID and pwd strings have variable length, with a max of let's say 25 bytes. So I allocated 2x25 bytes in the EEPROM.
Everything works properly, except one thing: retrieving the 25bytes for SSID (and pwd) ends up with the SSID id and pwd plus a number of padding nul chars at the end.
How can I strip the non-printable characters?
Using B4R 3.31

Thanks to everybody.
 

MathiasM

Active Member
Licensed User
You could just post a "length" byte at a fixed position, then the SSID, after that a length byte for the pwd, then the password.

Now you can 'calculate' the bytes you need to retrieve by the length bytes.
 
Upvote 0
Top