Node Handler

The NodeHandler Library

The NodeHandler library is centred on a Node class that defines the characteristics of individual Nodes within the network. The settings managed within the NodeHandler are currently static but the ultimate intention is that individual Nodes would identify themselves through some form of dynamic discovery process and that the NodeHandler would simply assemble and manage this information. While the Node class is currently public, it is only used within the PacketHandler and then primarily by the Gateway sketch to identify the characteristics of individual network Nodes.

In this context, a Node is generally defined by its MAC address, a descriptive name and the root level topic that is used to generate MQTT messages that convey the status of sensors managed by that Node.

The Node class also includes a set of 'heartbeat' variables that are used by the Gateway to determine whether or not a Node is 'alive'. Given that the present packet delivery mechanism is 'unreliable' by default (i.e. packet receipt is not acknowledged), the Gateway is allowed to miss a predefined number of consecutive transmissions from any given Node before declaring it to be 'dead', and perhaps raising some alarm. The heartbeat timer for any particular Node is reset by the Gateway every time a packet is received from that Node.

The NodeHandler library is currently only used within the PacketHandler library and was only ever intended to be a temporary solution to the management of individual Node parameters. Like many 'temporary' things, however, it's become a little more than temporary and I will provide the details of the library elements here in due course. In the interim, I have endeavoured to provide a brief description of the essential elements in the library files themselves.

Further details pending...

07-09-2024