String constants
Posted: Sat Dec 16, 2023 8:14 am
I hit upon an issue trying to get an esp32 to connect to wifi using v5.1.1
I had string constants (local to main) .ssid and.pswd (say "SSID" and "PASSWORD" for example)
Then I call ConnectToSSID(.ssid, .pswd, 60)
This fails to connect - and the error messages output to UART have 'Failed to connect to SSID SSIDPASSWORD Password WORD")
Passing the values in the function (So ConnectToSSID("SSID", "PASSWORD", 60) connects correctly)
The string constants aren't terminated or treated correctly? I didn't test but I suspect adding a terminator ("SSID\0") would fix this?
Martin
I had string constants (local to main) .ssid and.pswd (say "SSID" and "PASSWORD" for example)
Then I call ConnectToSSID(.ssid, .pswd, 60)
This fails to connect - and the error messages output to UART have 'Failed to connect to SSID SSIDPASSWORD Password WORD")
Passing the values in the function (So ConnectToSSID("SSID", "PASSWORD", 60) connects correctly)
The string constants aren't terminated or treated correctly? I didn't test but I suspect adding a terminator ("SSID\0") would fix this?
Martin