thermferm/mqtt.h

Thu, 19 Jul 2018 14:08:32 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Thu, 19 Jul 2018 14:08:32 +0200
changeset 547
0e4d4b45249f
parent 545
c382a6c58c20
child 554
ab9f22ab57b5
permissions
-rw-r--r--

Versie 0.8.0. Fixed eerste DBIRTH fout geinitialiseerde waardes.

#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 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