star297
(Paul Staron)
1
Probably a silly question, but how do I include the quote character for the Mbed ESP8266 password
in the mbed_app.json file
I need to use this password:
Ft290?Ft101"Ic720#Ts850
"nsapi.default-wifi-password": "\"password\""
"nsapi.default-wifi-password": "\"Ft290?Ft101"Ic720#Ts850\""
I tried this:
"nsapi.default-wifi-password": "\"Ft290?Ft101\"Ic720#Ts850\""
But would not compile.
Can anyone help?
Thank you
ldong
(Lingkai Dong)
2
Hi @star297,
Any \"
in mbed_app.json
becomes "
in your source code. What you did was on point, but that would become
"Ft290?Ft101"Ic720#Ts850"
in the C/C++ code - the quotes are unmatched. What we need is add another slash \
in the middle (i.e. \\
in the json.
Could you try
"nsapi.default-wifi-password": "\"Ft290?Ft101\\\"Ic720#Ts850\""
so it becomes a correctly-quoted C/C++ string
"Ft290?Ft101\"Ic720#Ts850"
in your source file. The compiler eventually compiles it into Ft290?Ft101"Ic720#Ts850
.
star297
(Paul Staron)
3
Thank you Lingkai, nice explanation
that now compiles without errors.