Hey,
I’m attempting to send a device command to my Arduino (the one from the kit) and I want to include a payload. When I attempt to build it, it errs out.
The error I’m seeing is:
In function 'void handleCommand(LosantCommand*)': rgbled:26: error: invalid initialization of reference of type 'ArduinoJson::JsonObject&' from expression of type 'ArduinoJson::JsonObject*' JsonObject& payload = command->payload;
The revelant section of the code is:
void handleCommand(LosantCommand *command) { Serial.print("Command received: "); Serial.println(command->name); Serial.println(command->time); JsonObject& payload = command->payload; }
The code is copied from the Losant Github docs.
I’m not super familiar with C, but I guessed it was related to pointer vs object, so I changed the offending line to:
JsonObject* payload = command->payload;
It compiles but I can’t get any of the payload values!
Any help would be appreciated!