Need to convert ASCII Dec serial data stored as a string to ASCII characters stored as a string and push to network connection SSID & network password

First, sorry my code didn't do what you expected :blush:
That was a stupid mistake/typo. In the second strtok() call I had an empty terminator string ("") where it should have contained a blank (" ").
Corrected above - when you try to understand how the provided code works, it'd also be easy to spot the mistake :wink:

But for this

My code leaves the data in a "string variable" (dest) - just not in a "String variable/object" (or std::string for that matter).
In C/C++ a string is nothing other than a series of characters in memory terminated with a zero-character. Even String objects store their string contents in such an array.
But I personally refrain from using String objects wherever possible on these tiny devices as they may lead to heap fragmentation and hence instability over time.

1 Like