bmsd/nodes.h

Wed, 20 May 2020 21:49:09 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Wed, 20 May 2020 21:49:09 +0200
changeset 684
ccb9f24d0fe9
parent 384
442d23455ae4
child 686
ca1fbb3bd3db
permissions
-rw-r--r--

Report any online status change via websocket broadcast. When starting, load all in memory tables sorted. The websocket status on the web pages has it's own panel. Prepared the menu system for dynamic updates.

0
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 /**
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2 * @file nodes.h
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3 */
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 #ifndef _NODES_H
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 #define _NODES_H
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 void node_dump(sys_node_list *node);
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 /**
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 * @brief Birth of a node or data update. Create it in the database if
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12 * never seen before, else just update the database entry.
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13 * @param topic The MQTT topic string, contains the node type and name.
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14 * @param payload The JSON formatted payload with the node details.
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
15 */
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
16 void node_birth_data(char *topic, char *payload);
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
18 /**
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
19 * @brief Death of a node. Mark it offline in the database.
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
20 * @param topic The MQTT topic string, contains the node type and name.
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
21 */
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
22 void node_death(char *topic);
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
23
384
442d23455ae4 The bms daemon now checks if a node went away of no data is received for 10 minutes.
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
24 /**
442d23455ae4 The bms daemon now checks if a node went away of no data is received for 10 minutes.
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
25 * @brief Check if nodes are still online and mark them offline if not
684
ccb9f24d0fe9 Report any online status change via websocket broadcast. When starting, load all in memory tables sorted. The websocket status on the web pages has it's own panel. Prepared the menu system for dynamic updates.
Michiel Broek <mbroek@mbse.eu>
parents: 384
diff changeset
26 * been seen for twice the node interval time plus a few seconds..
384
442d23455ae4 The bms daemon now checks if a node went away of no data is received for 10 minutes.
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
27 */
442d23455ae4 The bms daemon now checks if a node went away of no data is received for 10 minutes.
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
28 void nodes_check_online(void);
442d23455ae4 The bms daemon now checks if a node went away of no data is received for 10 minutes.
Michiel Broek <mbroek@mbse.eu>
parents: 0
diff changeset
29
684
ccb9f24d0fe9 Report any online status change via websocket broadcast. When starting, load all in memory tables sorted. The websocket status on the web pages has it's own panel. Prepared the menu system for dynamic updates.
Michiel Broek <mbroek@mbse.eu>
parents: 384
diff changeset
30 /**
ccb9f24d0fe9 Report any online status change via websocket broadcast. When starting, load all in memory tables sorted. The websocket status on the web pages has it's own panel. Prepared the menu system for dynamic updates.
Michiel Broek <mbroek@mbse.eu>
parents: 384
diff changeset
31 * @brief Report status change of nodes so that the client menus are updated.
ccb9f24d0fe9 Report any online status change via websocket broadcast. When starting, load all in memory tables sorted. The websocket status on the web pages has it's own panel. Prepared the menu system for dynamic updates.
Michiel Broek <mbroek@mbse.eu>
parents: 384
diff changeset
32 */
ccb9f24d0fe9 Report any online status change via websocket broadcast. When starting, load all in memory tables sorted. The websocket status on the web pages has it's own panel. Prepared the menu system for dynamic updates.
Michiel Broek <mbroek@mbse.eu>
parents: 384
diff changeset
33 void status_change(void);
ccb9f24d0fe9 Report any online status change via websocket broadcast. When starting, load all in memory tables sorted. The websocket status on the web pages has it's own panel. Prepared the menu system for dynamic updates.
Michiel Broek <mbroek@mbse.eu>
parents: 384
diff changeset
34
0
033898178630 Versio 0.0.2 initial check in
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
35 #endif

mercurial