bmsd/mqtt.h

Sat, 12 Sep 2020 16:29:26 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sat, 12 Sep 2020 16:29:26 +0200
changeset 718
59b02b64131b
parent 679
48f8f3fce7c0
permissions
-rw-r--r--

Version 0.3.36. Removed debug logs for websocket received messages. Fixed some default enum values send to the MySQL server.

#ifndef _MQTT_H
#define	_MQTT_H

#define STATUS_CONNECTING 0
#define STATUS_CONNACK_RECVD 1
#define STATUS_WAITING 2


/**
 * @brief Publish MQTT message.
 * @param topic The topic part of the message.
 * @param payload The payload part of the message.
 */
void mqtt_publish(char *topic, char *payload);

/**
 * @brief Connect to the MQTT server.
 * @return 0 if success, else the connection failed.
 */
int mqtt_connect(void);

/**
 * @brief Disconnect from the MQTT server.
 */
void mqtt_disconnect(void);

#endif

mercurial