thermferm/mqtt.h

Tue, 31 Jul 2018 16:42:11 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Tue, 31 Jul 2018 16:42:11 +0200
changeset 554
ab9f22ab57b5
parent 547
0e4d4b45249f
child 557
ae17042a6d39
permissions
-rw-r--r--

Versie 0.8.5. Implementatie product code en product naam. Implementatie DLOG MQTT berichten. Verminderde server rotocol debug berichten.

#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