![]() |
Morse Micro IoT SDK
2.9.7
|
Data Structures | |
| struct | mmagic_core_mqtt_start_agent_cmd_args |
| Command arguments structure for mqtt_start_agent. More... | |
| struct | mmagic_core_mqtt_start_agent_rsp_args |
| Response arguments structure for mqtt_start_agent. More... | |
| struct | mmagic_core_mqtt_publish_cmd_args |
| Command arguments structure for mqtt_publish. More... | |
| struct | mmagic_core_mqtt_subscribe_cmd_args |
| Command arguments structure for mqtt_subscribe. More... | |
| struct | mmagic_core_mqtt_stop_agent_cmd_args |
| Command arguments structure for mqtt_stop_agent. More... | |
| struct | mmagic_mqtt_message_received_event_args |
| Event arguments structure for mqtt_message_received. More... | |
| struct | mmagic_mqtt_broker_connection_event_args |
| Event arguments structure for mqtt_broker_connection. More... | |
Typedefs | |
| typedef void(* | mmagic_mqtt_message_received_event_handler_t) (const struct mmagic_mqtt_message_received_event_args *event_args, void *arg) |
| Handler for the mqtt-message_received event. More... | |
| typedef void(* | mmagic_mqtt_broker_connection_event_handler_t) (const struct mmagic_mqtt_broker_connection_event_args *event_args, void *arg) |
| Handler for the mqtt-broker_connection event. More... | |
Functions | |
| static enum mmagic_status | mmagic_controller_mqtt_start_agent (struct mmagic_controller *controller, struct mmagic_core_mqtt_start_agent_cmd_args *cmd_args, struct mmagic_core_mqtt_start_agent_rsp_args *rsp_args) |
| Starts the MQTT agent. More... | |
| static enum mmagic_status | mmagic_controller_mqtt_publish (struct mmagic_controller *controller, struct mmagic_core_mqtt_publish_cmd_args *cmd_args) |
| Publishes a message on a topic. More... | |
| static enum mmagic_status | mmagic_controller_mqtt_subscribe (struct mmagic_controller *controller, struct mmagic_core_mqtt_subscribe_cmd_args *cmd_args) |
| Subscribes to a topic. More... | |
| static enum mmagic_status | mmagic_controller_mqtt_stop_agent (struct mmagic_controller *controller, struct mmagic_core_mqtt_stop_agent_cmd_args *cmd_args) |
| Stops the MQTT agent. More... | |
| void | mmagic_controller_register_mqtt_message_received_handler (struct mmagic_controller *controller, mmagic_mqtt_message_received_event_handler_t handler, void *arg) |
| Register a handler for the mqtt-message_received event. More... | |
| void | mmagic_controller_register_mqtt_broker_connection_handler (struct mmagic_controller *controller, mmagic_mqtt_broker_connection_event_handler_t handler, void *arg) |
| Register a handler for the mqtt-broker_connection event. More... | |
| typedef void(* mmagic_mqtt_broker_connection_event_handler_t) (const struct mmagic_mqtt_broker_connection_event_args *event_args, void *arg) |
Handler for the mqtt-broker_connection event.
State of the connection to the broker (see mqtt-start).
| event_args | Notication arguments received from the agent. |
| arg | Opaque argument that was provided when the callback was registered. |
Definition at line 5708 of file mmagic_controller.h.
| typedef void(* mmagic_mqtt_message_received_event_handler_t) (const struct mmagic_mqtt_message_received_event_args *event_args, void *arg) |
Handler for the mqtt-message_received event.
Triggered when a message is received on a topic that has been subscribed to.
| event_args | Notication arguments received from the agent. |
| arg | Opaque argument that was provided when the callback was registered. |
Definition at line 5665 of file mmagic_controller.h.
|
inlinestatic |
Publishes a message on a topic.
| controller | Reference to the controller handle. | |
| [in] | cmd_args | Command arguments |
Definition at line 5547 of file mmagic_controller.h.
|
inlinestatic |
Starts the MQTT agent.
Automatically handles reconnects with a backoff timer and saves up to 10 subscriptions across reconnects. Listen to "broker_connection" events for information about the state of the connection to the broker.
| controller | Reference to the controller handle. | |
| [in] | cmd_args | Command arguments |
| [out] | rsp_args | Pointer to the data structure to be filled out with the result. If the If the return code is not MMAGIC_STATUS_OK then the contents of this structure will be undefined. |
Definition at line 5504 of file mmagic_controller.h.
|
inlinestatic |
Stops the MQTT agent.
| controller | Reference to the controller handle. | |
| [in] | cmd_args | Command arguments |
Definition at line 5621 of file mmagic_controller.h.
|
inlinestatic |
Subscribes to a topic.
Messages will arrive in the "message_received" event.
| controller | Reference to the controller handle. | |
| [in] | cmd_args | Command arguments |
Definition at line 5586 of file mmagic_controller.h.
| void mmagic_controller_register_mqtt_broker_connection_handler | ( | struct mmagic_controller * | controller, |
| mmagic_mqtt_broker_connection_event_handler_t | handler, | ||
| void * | arg | ||
| ) |
Register a handler for the mqtt-broker_connection event.
State of the connection to the broker (see mqtt-start).
| controller | Reference to the the controller handle. |
| handler | The handler function to register. |
| arg | Opaque argument to be passed to the handler when it is invoked. |
| void mmagic_controller_register_mqtt_message_received_handler | ( | struct mmagic_controller * | controller, |
| mmagic_mqtt_message_received_event_handler_t | handler, | ||
| void * | arg | ||
| ) |
Register a handler for the mqtt-message_received event.
Triggered when a message is received on a topic that has been subscribed to.
| controller | Reference to the the controller handle. |
| handler | The handler function to register. |
| arg | Opaque argument to be passed to the handler when it is invoked. |