gos_dms_messsage_config_t Struct Reference

DMS Message Configuration. More...

Data Fields

uint32_t length
bool is_response
gos_handler_t handler
uint32_t timeout_ms

Detailed Description

DMS Message Configuration.

This is used to configure an outgoing message to the DMS (sent via secure websocket)

Examples:
dms/messages/main.c .

Field Documentation

handler

gos_handler_t gos_dms_messsage_config_t::handler

Handler to be invoke when the outgoing receives a response from the DMS Leave NULL to not listen for the message's response The argument of the handler is a gos_msgpack_object_t which contains the parsed response If the response times-out, then the argument is NULL This executes in the User App Thread

is_response

bool gos_dms_messsage_config_t::is_response

Set to true if this message is a response to a received message. If this is set to true then you must manually write the message ID field to message

length

uint32_t gos_dms_messsage_config_t::length

The message's payload length. Leave a 0 if the initial length is unknown

Note
If the length = 0, then the entire message is buffered to RAM before transmitting to the DMS If the length > 0, then the message is transmitted to the DMS as it is written.
Examples:
dms/messages/main.c .

timeout_ms

uint32_t gos_dms_messsage_config_t::timeout_ms

Maximum in milliseconds to wait for the message's response On timeout, the supplied handler is invoked with a NULL argument