9 #ifndef __ewf_adapter_mqtt__h__included__
10 #define __ewf_adapter_mqtt__h__included__
64 ewf_adapter_mqtt_qos_0 = 0,
65 ewf_adapter_mqtt_qos_1 = 1,
66 ewf_adapter_mqtt_qos_2 = 2,
68 ewf_adapter_mqtt_qos_error = -1,
76 ewf_adapter_mqtt_qos QoS;
78 uint32_t payload_length;
86 ewf_result(*query)(
ewf_socket_mqtt* socket_ptr,
const char* command_cstr, uint8_t* buffer_ptr, uint32_t* buffer_length_ptr);
91 ewf_result(*connect)(
ewf_socket_mqtt* socket_ptr,
const char* server_str, uint32_t port,
const char* clientid_str,
const char* username_str,
const char* password_str);
94 ewf_result(*publish_buffer)(
ewf_socket_mqtt* socket_ptr,
const char* topic_str,
const uint8_t* message_ptr, uint32_t message_size);
The Embedded Wireless Framework.
ewf_result ewf_adapter_mqtt_publish_message(ewf_socket_mqtt *socket_ptr, const char *topic_str, const ewf_adapter_mqtt_message *message_ptr)
Publish a message to to a topic.
ewf_result(* ewf_adapter_mqtt_message_callback)(ewf_socket_mqtt *socket_ptr, const char *topic_str, ewf_adapter_mqtt_message *message_ptr)
A function pointer type for MQTT message callbacks.
Definition: ewf_adapter_api_mqtt.h:50
ewf_result ewf_adapter_mqtt_subscribe(ewf_socket_mqtt *socket_ptr, const char *topic_str, ewf_adapter_mqtt_qos qos)
Subscribe to a topic.
ewf_result ewf_adapter_mqtt_state_callback_set(ewf_socket_mqtt *socket_ptr, ewf_adapter_mqtt_state_callback callback)
Register a callback for state changes.
ewf_result ewf_adapter_mqtt_open(ewf_adapter *adapter_ptr, ewf_socket_mqtt *socket_ptr)
Open an MQTT socket.
ewf_result ewf_adapter_mqtt_publish_buffer(ewf_socket_mqtt *socket_ptr, const char *topic_str, const uint8_t *message_ptr, uint32_t message_size)
Publish a message to to a topic.
ewf_result ewf_adapter_mqtt_publish_string(ewf_socket_mqtt *socket_ptr, const char *topic_str, const char *message_str)
Publish a message to to a topic.
ewf_result ewf_adapter_mqtt_subscribe_with_result(ewf_socket_mqtt *socket_ptr, const char *topic_str, ewf_adapter_mqtt_qos *qos_ptr)
Subscribe to a topic.
struct _ewf_adapter_api_mqtt ewf_adapter_api_mqtt
ewf_result ewf_adapter_mqtt_connect(ewf_socket_mqtt *socket_ptr, const char *server_str, uint32_t port, const char *clientid_str, const char *username_str, const char *password_str)
Connect to an MQTT server.
ewf_result ewf_adapter_mqtt_unsubscribe(ewf_socket_mqtt *socket_ptr, const char *topic_str)
Unsubscribe from a topic.
ewf_result ewf_adapter_mqtt_disconnect(ewf_socket_mqtt *socket_ptr)
Disconnect from an MQTT server.
_ewf_adapter_mqtt_qos
The MQTT QoS enumeration definition.
Definition: ewf_adapter_api_mqtt.h:63
ewf_result ewf_adapter_mqtt_set_tls_configuration(ewf_socket_mqtt *socket_ptr, uint32_t tls_configuration_id)
Set the TLS context for the socket.
ewf_result ewf_adapter_mqtt_close(ewf_socket_mqtt *socket_ptr)
Close an MQTT socket.
ewf_result ewf_adapter_mqtt_message_callback_set(ewf_socket_mqtt *socket_ptr, ewf_adapter_mqtt_message_callback callback)
Register a callback for subscribed messages.
ewf_result(* ewf_adapter_mqtt_state_callback)(ewf_socket_mqtt *socket_ptr, const char *state_cstr, const char *param_cstr)
A function pointer type for MQTT basic API state callbacks.
Definition: ewf_adapter_api_mqtt.h:43
enum _ewf_result ewf_result
Success and error result codes specific to the EWF API.
Definition: ewf_adapter_api_mqtt.h:84
The MQTT Message structure definition.
Definition: ewf_adapter_api_mqtt.h:73
The EWF network adapter control structure definition.
Definition: ewf_adapter.h:50
The MQTT socket structure definition.
Definition: ewf_adapter_api_mqtt.h:54