MQTT functions for connecting, disconnecting. publishing and subscribing.
More...
|
enum | _ewf_adapter_mqtt_qos { ewf_adapter_mqtt_qos_0 = 0
, ewf_adapter_mqtt_qos_1 = 1
, ewf_adapter_mqtt_qos_2 = 2
, ewf_adapter_mqtt_qos_error = -1
} |
| The MQTT QoS enumeration definition.
|
|
|
ewf_result | ewf_adapter_mqtt_open (ewf_adapter *adapter_ptr, ewf_socket_mqtt *socket_ptr) |
| Open an MQTT socket. More...
|
|
ewf_result | ewf_adapter_mqtt_close (ewf_socket_mqtt *socket_ptr) |
| Close an MQTT socket. More...
|
|
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. More...
|
|
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. More...
|
|
ewf_result | ewf_adapter_mqtt_disconnect (ewf_socket_mqtt *socket_ptr) |
| Disconnect from an MQTT server. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
ewf_result | ewf_adapter_mqtt_subscribe (ewf_socket_mqtt *socket_ptr, const char *topic_str, ewf_adapter_mqtt_qos qos) |
| Subscribe to a topic. More...
|
|
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. More...
|
|
ewf_result | ewf_adapter_mqtt_unsubscribe (ewf_socket_mqtt *socket_ptr, const char *topic_str) |
| Unsubscribe from a topic. More...
|
|
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. More...
|
|
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. More...
|
|
MQTT functions for connecting, disconnecting. publishing and subscribing.
◆ ewf_adapter_api_mqtt
◆ ewf_adapter_mqtt_message_callback
A function pointer type for MQTT message callbacks.
- Parameters
-
[in] | adapter_ptr | a pointer to an adapter structure |
- Returns
- ewf_result success and error conditions
◆ ewf_adapter_mqtt_state_callback
typedef 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.
- Parameters
-
[in] | adapter_ptr | a pointer to an adapter structure |
[in] | state_cstr | a pointer to the state string |
[in] | param_cstr | a pointer to the state param string |
- Returns
- ewf_result success and error conditions
◆ ewf_adapter_mqtt_close()
Close an MQTT socket.
- Parameters
-
[in] | socket_ptr | a pointer to an MQTT socket structure |
- Returns
- ewf_result success and error conditions
◆ ewf_adapter_mqtt_connect()
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.
- Parameters
-
[in] | socket_ptr | a pointer to an MQTT socket structure |
- Returns
- ewf_result success and error conditions
◆ ewf_adapter_mqtt_disconnect()
Disconnect from an MQTT server.
- Parameters
-
[in] | socket_ptr | a pointer to an MQTT socket structure |
- Returns
- ewf_result success and error conditions
◆ ewf_adapter_mqtt_message_callback_set()
Register a callback for subscribed messages.
- Parameters
-
[in] | socket_ptr | a pointer to an MQTT socket structure |
[in] | callback | a pointer to the callback |
- Returns
- ewf_result success and error conditions
◆ ewf_adapter_mqtt_open()
Open an MQTT socket.
- Parameters
-
[in] | adapter_ptr | a pointer to an adapter structure |
[in,out] | socket | a pointer to a variable that will hold the MQTT socket |
- Returns
- ewf_result success and error conditions
◆ ewf_adapter_mqtt_publish_buffer()
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.
- Parameters
-
[in] | socket_ptr | a pointer to an MQTT socket structure |
- Returns
- ewf_result success and error conditions
◆ ewf_adapter_mqtt_publish_message()
Publish a message to to a topic.
- Parameters
-
[in] | socket_ptr | a pointer to an MQTT socket structure |
- Returns
- ewf_result success and error conditions
◆ ewf_adapter_mqtt_publish_string()
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.
- Parameters
-
[in] | socket_ptr | a pointer to an MQTT socket structure |
- Returns
- ewf_result success and error conditions
◆ ewf_adapter_mqtt_set_tls_configuration()
Set the TLS context for the socket.
- Parameters
-
[in] | socket_ptr | a pointer to an MQTT socket structure |
- Returns
- ewf_result success and error conditions
◆ ewf_adapter_mqtt_state_callback_set()
Register a callback for state changes.
- Parameters
-
[in] | socket_ptr | a pointer to an MQTT socket structure |
[in] | callback | a pointer to the callback |
- Returns
- ewf_result success and error conditions
◆ ewf_adapter_mqtt_subscribe()
Subscribe to a topic.
- Parameters
-
[in] | socket_ptr | a pointer to an MQTT socket structure |
[in] | topic_str | a pointer to a topic string to subscribe to |
[in] | qos | a requested QoS |
- Returns
- ewf_result success and error conditions
◆ ewf_adapter_mqtt_subscribe_with_result()
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.
- Parameters
-
[in] | socket_ptr | a pointer to an MQTT socket structure |
[in] | topic_str | a pointer to a topic string to subscribe to |
[in,out] | qos_ptr | a pointer to a requested QoS, on exit the granted QoS |
- Returns
- ewf_result success and error conditions
◆ ewf_adapter_mqtt_unsubscribe()
Unsubscribe from a topic.
- Parameters
-
[in] | socket_ptr | a pointer to an MQTT socket structure |
- Returns
- ewf_result success and error conditions