Embedded Wireless Framework
Data Structures | Typedefs | Functions
Adapter MQTT basic API

MQTT basic API functions for connecting, disconnecting. publishing and subscribing. More...

Data Structures

struct  _ewf_adapter_api_mqtt_basic
 

Typedefs

typedef ewf_result(* ewf_adapter_mqtt_basic_state_callback) (ewf_adapter *adapter_ptr, const char *state_cstr, const char *param_cstr)
 A function pointer type for MQTT basic API state callbacks. More...
 
typedef ewf_result(* ewf_adapter_mqtt_basic_message_callback) (ewf_adapter *adapter_ptr, const char *topic_cstr, const char *payload_cstr)
 A function pointer type for MQTT basic API message callbacks. More...
 
typedef struct _ewf_adapter_api_mqtt_basic ewf_adapter_api_mqtt_basic
 

Functions

ewf_result ewf_adapter_mqtt_basic_control (ewf_adapter *adapter_ptr, const char *command_cstr, uint8_t *buffer_ptr, uint32_t *buffer_length_ptr)
 
ewf_result ewf_adapter_mqtt_basic_connect (ewf_adapter *adapter_ptr, char const *server_cstr, uint32_t port, char const *clientid_cstrs, char const *username_cstr, char const *password_cstr)
 
ewf_result ewf_adapter_mqtt_basic_disconnect (ewf_adapter *adapter_ptr)
 
ewf_result ewf_adapter_mqtt_basic_subscribe (ewf_adapter *adapter_ptr, char const *topic_cstr)
 
ewf_result ewf_adapter_mqtt_basic_unsubscribe (ewf_adapter *adapter_ptr, char const *topic_cstr)
 
ewf_result ewf_adapter_mqtt_basic_publish (ewf_adapter *adapter_ptr, const char *topic_cstr, const char *message_cstr)
 
ewf_result ewf_adapter_mqtt_basic_message_get (ewf_adapter *adapter_ptr, const char *topic_cstr, char *message_buffer_ptr)
 
ewf_result ewf_adapter_mqtt_basic_state_callback_set (ewf_adapter *adapter_ptr, ewf_adapter_mqtt_basic_state_callback callback)
 
ewf_result ewf_adapter_mqtt_basic_message_callback_set (ewf_adapter *adapter_ptr, ewf_adapter_mqtt_basic_message_callback callback)
 

Detailed Description

MQTT basic API functions for connecting, disconnecting. publishing and subscribing.

Typedef Documentation

◆ ewf_adapter_api_mqtt_basic

@breif the MQTT basic API type

◆ ewf_adapter_mqtt_basic_message_callback

typedef ewf_result(* ewf_adapter_mqtt_basic_message_callback) (ewf_adapter *adapter_ptr, const char *topic_cstr, const char *payload_cstr)

A function pointer type for MQTT basic API message callbacks.

Parameters
[in]adapter_ptra pointer to an adapter structure
[in]topic_cstra pointer to the topic string
[in]payload_cstra pointer to the payload string
Returns
ewf_result success and error conditions

This user callback will provide MQTT topic and payload information if provided by the adapter modem, else the information will be NULL. If the payload in the callback is NULL,the application must use the ewf_adapter_mqtt_basic_message_get() to get the payload associated with the Topic received.

For example Topic and Payload information is available for Quectel modems, while only Topic information is available for Renesas/Sequans adapter modem.

◆ ewf_adapter_mqtt_basic_state_callback

typedef ewf_result(* ewf_adapter_mqtt_basic_state_callback) (ewf_adapter *adapter_ptr, const char *state_cstr, const char *param_cstr)

A function pointer type for MQTT basic API state callbacks.

Parameters
[in]adapter_ptra pointer to an adapter structure
[in]state_cstra pointer to the state string
[in]param_cstra pointer to the state param string
Returns
ewf_result success and error conditions