thermferm/mqtt.h

Wed, 01 Aug 2018 22:27:58 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Wed, 01 Aug 2018 22:27:58 +0200
changeset 556
c2ee7f9a069e
parent 554
ab9f22ab57b5
child 557
ae17042a6d39
permissions
-rw-r--r--

Fixed compile for LCD display

#ifndef	_MQTT_H
#define	_MQTT_H

#ifdef HAVE_MOSQUITTO_H

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


/*
 * Public functions
 */
void pub_domoticz_temp(int, int);
void pub_domoticz_output(int, int);
void mqtt_connect(void);
void mqtt_disconnect(void);

/**
 * @brief Publish DBIRTH for all active units. If there are no active units, don't
 *        publish anything. This function should be called at program start.
 */
void publishDBirthAll(void);

/**
 * @brief Publish unit data.
 * @param unit Unit data structure.
 */
void publishDData(units_list *unit);

/**
 * @brief Publish unit birth.
 * @param unit Unit data structure.
 */
void publishDBirth(units_list *unit);

/**
 * @brief Publish death of a unit.
 * @param unit Unit data structure.
 */
void publishDDeath(units_list *unit);

/**
 * @brief Publish log data.
 * @param unit Unit data structure.
 */
void publishDLog(units_list *unit);

/**
 * @brief Publish Node data or birth message.
 * @param birth If true send a birh message, else a regular data update.
 * @param flag Bit flag to enable control messages.
 */
void publishNData(bool birth, int flag);

#endif

#endif

mercurial