blob: 8fa3b450fc1871896b21ef50b50c50336887941f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#ifndef _MQTTCONNECTION_H_
#define _MQTTCONNECTION_H_
#define LED_CONTROL_OVER_MQTT DK_LED1 /* Stratus LED to control over MQTT */
#define IMEI_LEN 15
#define CGSN_RESPONSE_LENGTH (IMEI_LEN + 6 + 1) /* Add 6 for \r\nOK\r\n and 1 for \0 */
#define CLIENT_ID_LEN sizeof("nrf-") + IMEI_LEN
/**@brief Initialize the MQTT client structure
*/
int client_init(struct mqtt_client *client);
/**@brief Initialize the file descriptor structure used by poll.
*/
int fds_init(struct mqtt_client *c, struct pollfd *fds);
/**@brief Function to publish data on the configured topic
*/
int data_publish(struct mqtt_client *c, enum mqtt_qos qos,
uint8_t *data, size_t len);
int publish_wrap(struct mqtt_client *c, uint8_t* topic, uint8_t *data, size_t len);
#endif /* _CONNECTION_H_ */
|