You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Hi, I feel rather stupid to report such a profound issue. I followed the instructions which are pretty easy and it did not help.
This is the function I added:
The strange thing is, the code used to work just perfectly until I involuntary updated the PlatformIO configuration. In that moment, quite a lot of packages got updated and I can't figure out, which ones.
I mean, wouldn't it be kind of to be expected that ArduinoJson is perfectly capable of serialize a simple char?
I can go around the issue by putting my char into a const char* but it just feels wrong.
Any hint of what the real reason behind this issue could be?
Troubleshooter's report
The issue happens at compile time
Error says "no matching function for call to ..."
Error says "no matching function for call to convertToJson(...)"
Remarks
I made sure that my extra convertToJson was actually compiled by just adding a syntax error in front of the function declaration and got the expected error from the compiler.
I can not figure out why the compiler would not be satisfied with my convertToJson function. But much more curious actually is, why do I get the error in the first place? I'm sure ArduinoJson would be able to encode a simple char. Other types work perfectly, I mean: bool, int, unsigned int, const char*, doubles, String etc.
Thanks a lot for your time to read this!
BR
Phil
The text was updated successfully, but these errors were encountered:
Since char is a built-in type, ADL ignores it and searches only in JsonVariant's namespace, ArduinoJson.
Here is an updated (and optimized) version of your converter:
Please note that older versions of ArduinoJson treated chars as integers, which is not what we do in this converter.
Support for char was deprecated in ArduinoJson 6.18.0 then removed in ArduinoJson 6.20.0.
Description
Hi, I feel rather stupid to report such a profound issue. I followed the instructions which are pretty easy and it did not help.
This is the function I added:
The strange thing is, the code used to work just perfectly until I involuntary updated the PlatformIO configuration. In that moment, quite a lot of packages got updated and I can't figure out, which ones.
I mean, wouldn't it be kind of to be expected that ArduinoJson is perfectly capable of serialize a simple char?
I can go around the issue by putting my char into a const char* but it just feels wrong.
Any hint of what the real reason behind this issue could be?
Troubleshooter's report
convertToJson(...)
"Environment
Reproduction code
Remarks
I made sure that my extra convertToJson was actually compiled by just adding a syntax error in front of the function declaration and got the expected error from the compiler.
I can not figure out why the compiler would not be satisfied with my convertToJson function. But much more curious actually is, why do I get the error in the first place? I'm sure ArduinoJson would be able to encode a simple char. Other types work perfectly, I mean: bool, int, unsigned int, const char*, doubles, String etc.
Thanks a lot for your time to read this!
BR
Phil
The text was updated successfully, but these errors were encountered: