summaryrefslogtreecommitdiff
path: root/modules/mqtt/mqtt.h
blob: e79fb6ed9f6158deaa6e22c8df6c52f4b12aa26d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
struct mqtt {
	struct mosquitto *mosq;
	struct tmr tmr;
	int fd;
};


/*
 * Subscribe direction (incoming)
 */

int  mqtt_subscribe_init(struct mqtt *mqtt);
int  mqtt_subscribe_start(struct mqtt *mqtt);
void mqtt_subscribe_close(void);


/*
 * Publish direction (outgoing)
 */

int  mqtt_publish_init(struct mqtt *mqtt);
void mqtt_publish_close(void);
int  mqtt_publish_message(struct mqtt *mqtt, const char *topic,
			  const char *fmt, ...);