-
Notifications
You must be signed in to change notification settings - Fork 5
Functions high level overview
Mitra Ardron edited this page May 18, 2025
·
3 revisions
This is a high level view of the functions that occur on lots of classes of Frugal IoT
| Abbreviations | Means |
|---|---|
| S, A, or C. | An Actuator, Sensor or Control |
| INxxx or OUTxxx | An INuint16 INbool INcolor etc |
| Function | |
|---|---|
| mqtt.dispatch(path, payload) | if isSet calls Actuator.dispatchTwigAll |
| A.dispatchTwigAll(twig,payload,isSet) | calls all A.dispatchTwig |
| A.dispatchTwig(id, leaf, payload, isSet=true) | Calls each INxxx.dispatchLeaf then A.act if any change |
| A.act() | Reads from INxxx.value etc and takes action (such as changing outputs) |
As for Actuators:
mqtt.dispatch => (if isSet) Sensor.dispatchTwigAll -> s.dispatchTwig -> OUTxxx.dispatchLeaf but doesnt call act
| Function | |
|---|---|
| Loop (or periodically) | readAndSet |
| S.readAndSet | reads physical sensor, calls S.set or OUTxxx.set directly |
| S.set(...) | calls OUTxxx.set |
| OUTxxx.set | If changed calls Mqtt.messageSend and sendWired |
| OUTxxx.sendWired | calls Mqtt.messageSend |
| Function | |
|---|---|
| mqtt.dispatch(path, payload) | calls Control.dispatchTwigAll and Control.dispatchPathAll |
| C.dispatchTwigAll | calls each INxxx & OUTxxx.dispatchLeaf then if changed C.act() |
| C.act() | Makes state changes, the result of one or more messages being received, may call OUTxxx.set |
| OUTxxx.set | see Outgoing sensor readings |