Tizen RT Public API
v1.1 D4
|
Provides APIs for MQTT Client. More...
Files | |
file | mqtt_api.h |
APIs for MQTT Client(Subscriber/Publisher) | |
Data Structures | |
struct | _mqtt_msg_s |
Structure of MQTT message. More... | |
struct | _mqtt_tls_param_s |
Structure of MQTT security information. More... | |
struct | _mqtt_client_config_s |
Structure of MQTT client configuration. More... | |
struct | _mqtt_client_s |
Structure of MQTT client object. More... | |
Enumerations | |
enum | mqtt_client_state_e |
This enumeration describes the state of the MQTT client. More... | |
enum | mqtt_connection_result_e |
This enumeration describes the state of the MQTT connection result. More... | |
Functions | |
mqtt_client_t * | mqtt_init_client (mqtt_client_config_t *config) |
mqtt_init_client() initializes MQTT client More... | |
int | mqtt_deinit_client (mqtt_client_t *handle) |
mqtt_deinit_client() de-initializes MQTT client More... | |
int | mqtt_connect (mqtt_client_t *handle, char *addr, int port, int keep_alive) |
mqtt_connect() connects to a MQTT broker More... | |
int | mqtt_disconnect (mqtt_client_t *handle) |
mqtt_disconnect() disconnects from a MQTT broker More... | |
int | mqtt_publish (mqtt_client_t *handle, char *topic, char *data, uint32_t data_len, uint8_t qos, uint8_t retain) |
mqtt_publish() pusblishes message to a MQTT broker on the given topic More... | |
int | mqtt_subscribe (mqtt_client_t *handle, char *topic, uint8_t qos) |
mqtt_subscribe() subscribes for the specified topic with MQTT broker More... | |
int | mqtt_unsubscribe (mqtt_client_t *handle, char *topic) |
mqtt_unsubscribe() unsubscribes from the specified topic More... | |
Provides APIs for MQTT Client.
enum mqtt_client_state_e |
This enumeration describes the state of the MQTT client.
Definition at line 59 of file mqtt_api.h.
This enumeration describes the state of the MQTT connection result.
Definition at line 69 of file mqtt_api.h.
int mqtt_connect | ( | mqtt_client_t * | handle, |
char * | addr, | ||
int | port, | ||
int | keep_alive | ||
) |
mqtt_connect() connects to a MQTT broker
#include <network/mqtt/mqtt_api.h>
[in] | handle | the handle of MQTT client object |
[in] | addr | MQTT broker address |
[in] | port | MQTT broker port |
[in] | keep_alive | MQTT keep-alive time in second |
int mqtt_deinit_client | ( | mqtt_client_t * | handle | ) |
mqtt_deinit_client() de-initializes MQTT client
#include <network/mqtt/mqtt_api.h>
[in] | handle | the handle of MQTT client object |
int mqtt_disconnect | ( | mqtt_client_t * | handle | ) |
mqtt_disconnect() disconnects from a MQTT broker
#include <network/mqtt/mqtt_api.h>
[in] | handle | the handle of MQTT client object |
mqtt_client_t* mqtt_init_client | ( | mqtt_client_config_t * | config | ) |
mqtt_init_client() initializes MQTT client
#include <network/mqtt/mqtt_api.h>
[in] | config | the information of MQTT client object configuration |
int mqtt_publish | ( | mqtt_client_t * | handle, |
char * | topic, | ||
char * | data, | ||
uint32_t | data_len, | ||
uint8_t | qos, | ||
uint8_t | retain | ||
) |
mqtt_publish() pusblishes message to a MQTT broker on the given topic
#include <network/mqtt/mqtt_api.h>
[in] | handle | the handle of MQTT client object |
[in] | topic | the topic on which the message to be published |
[in] | data | the message to publish |
[in] | data_len | the length of message |
[in] | qos | the Quality of Service to be used for the message. QoS value should be 0,1 or 2. |
[in] | retain | the flag to make the message retained. |
int mqtt_subscribe | ( | mqtt_client_t * | handle, |
char * | topic, | ||
uint8_t | qos | ||
) |
mqtt_subscribe() subscribes for the specified topic with MQTT broker
#include <network/mqtt/mqtt_api.h>
[in] | handle | the handle of MQTT client object |
[in] | topic | the topic on which the message to be unsubscribed |
[in] | qos | the Quality of Service for the subscription. QoS value should be 0,1 or 2. |
int mqtt_unsubscribe | ( | mqtt_client_t * | handle, |
char * | topic | ||
) |
mqtt_unsubscribe() unsubscribes from the specified topic
#include <network/mqtt/mqtt_api.h>
[in] | handle | the handle of MQTT client object |
[in] | topic | the topic on which the message to be unsubscribed |