I am using IoT Central and am able to successfully send command to the device as well as receive confirmation code. This is executed using the following line:
azure_iot_send_command_response(azure_iot, command.request_id, response_code, AZ_SPAN_EMPTY);
AZ_SPAN_EMPTY is the payload portion that can be replaces with the JSON formatted response.
Most other actions have sub-routines defined to generate such response (such as: generate_telemetry_payload, generate_device_info_payload, generate_properties_update_response...etc).
I cannot see out of the box generate_command_response.
Am I missing something, can I reuse one of the existing routines or do I have to create my own? What is the common way of passing back payload on command execution?
Tried using functions to generate az_span_from_string etc but they do not generate the whole payload.
Tried formattign it using
static const az_span cmd = AZ_SPAN_LITERAL_FROM_STR("Hello world");
but the error is always:
Device XXXXXXX sent a response payload with a syntax error for method XXXXXXXXX in application XXXXXXX Error code: 400.070.002.052 / s6p8v199hr.2
The annoying part is that I cannot see the raw data to be able to figure out where the syntax problem is...hence my desire to use az_span standard method.