/
structure.txt
43 lines (29 loc) · 957 Bytes
/
structure.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
user_init() - entry point and setup
initSysCfg() - setup configuration
-- Init devices --
*_init()
sys_init_complete() - Called when system_init complete
- sets up callbacks for MQTT
- sets up MQTT client
- reports voltage
- Starts WiFi connecton
wifiConnectCb()
Connects to MQTT broker
Starts NTP, starts timer to call getCurrentTime()
or
Disconnects from MQTT for status != STATION_GOT_IP
mqttConnectedCb()
Starts device readings
*_start()
mqttPublishedCb()
*_is_complete() - to tell when devices have sent measurements
State machine waits for MQTT messages to complete and then
publishes a timestamp. When that drains it shuts down the system.
mqttDisconnectedCb()
Simply reports
mqttDataCb()
Called if MQTT message receive, but no subscriptions so not actually
used.
user_deep_sleep()
*_shutdown()
Goto to lowest power mode and sleep