thermferm/mqtt.h

Sat, 21 Jul 2018 20:40:02 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sat, 21 Jul 2018 20:40:02 +0200
changeset 549
ee1bcad035f0
parent 547
0e4d4b45249f
child 554
ab9f22ab57b5
permissions
-rw-r--r--

Versie 0.8.2. Node NBIRTH payload heeft nu netwerk informatie.

#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