EnigmaIOT
0.9.8
Secure sensor and gateway platform based on ESP8266 and ESP32
|
#include <NodeList.h>
Public Member Functions | |
NodeList () | |
Node list constructor. More... | |
Node * | getNodeFromID (uint16_t nodeId) |
Gets node that correspond with given nodeId. More... | |
Node * | getNodeFromMAC (const uint8_t *mac) |
Gets node that correspond with given address. More... | |
Node * | getNodeFromName (const char *name) |
Gets node that correspond with given node name. More... | |
int8_t | checkNodeName (const char *name, const uint8_t *address) |
Check Node name for duplicate. More... | |
Node * | findEmptyNode () |
Searches for a free place for a new Node instance. More... | |
uint16_t | countActiveNodes () |
Gets the number of active nodes (registered or registering) More... | |
bool | unregisterNode (uint16_t nodeId) |
Frees up a node and marks it as available. More... | |
bool | unregisterNode (const uint8_t *mac) |
Frees up a node and marks it as available. More... | |
bool | unregisterNode (Node *node) |
Frees up a node using a pointer to it. More... | |
Node * | getNextActiveNode (uint16_t nodeId) |
Gets next active node by nodeId. More... | |
Node * | getNextActiveNode (Node *node) |
Gets next active node by instance where to get nodeId. More... | |
Node * | getNewNode (const uint8_t *mac) |
Finds a node that correspond with given address of creates a new one if it does not exist. More... | |
void | printToSerial (Stream *port) |
Dumps node list data to a Stream object. More... | |
Node * | getBroadcastNode () |
Gets broadcas node instance. More... | |
void | initBroadcastNode () |
Init broadcast node data. More... | |
uint16_t | getLastBroadcastMsgCounter () |
Ask for last broadcast message counter state. More... | |
void | incLastBroadcastMsgCounter () |
Increments last broadcast message counter stata by one. More... | |
Protected Attributes | |
Node | nodes [NUM_NODES] |
Static Node array that holds maximum number of supported nodes. More... | |
Node | broadcastNode |
Node instance that holds data used for broadcast messages. This does not represent any individual node. More... | |
uint16_t | lastBroadcastMsgCounter |
Last broadcast message counter state for all nodes, both for data and control messages. More... | |
Definition at line 506 of file NodeList.h.
NodeList::NodeList | ( | ) |
Node list constructor.
Definition at line 129 of file NodeList.cpp.
int8_t NodeList::checkNodeName | ( | const char * | name, |
const uint8_t * | address | ||
) |
Check Node name for duplicate.
name | Custom node name |
address | Address of node which is being tried to set name |
Definition at line 201 of file NodeList.cpp.
uint16_t NodeList::countActiveNodes | ( | ) |
Gets the number of active nodes (registered or registering)
Definition at line 247 of file NodeList.cpp.
Node * NodeList::findEmptyNode | ( | ) |
Searches for a free place for a new Node instance.
Definition at line 234 of file NodeList.cpp.
|
inline |
Gets broadcas node instance.
Definition at line 607 of file NodeList.h.
|
inline |
Ask for last broadcast message counter state.
Definition at line 620 of file NodeList.h.
Node * NodeList::getNewNode | ( | const uint8_t * | mac | ) |
Finds a node that correspond with given address of creates a new one if it does not exist.
mac | address to search for |
Definition at line 324 of file NodeList.cpp.
Gets next active node by instance where to get nodeId.
node | Node which have the nodeId to find |
Definition at line 309 of file NodeList.cpp.
Node * NodeList::getNextActiveNode | ( | uint16_t | nodeId | ) |
Gets next active node by nodeId.
nodeId | NodeId of the node to find |
Definition at line 295 of file NodeList.cpp.
Node * NodeList::getNodeFromID | ( | uint16_t | nodeId | ) |
Gets node that correspond with given nodeId.
nodeId | NodeId to search for |
Definition at line 135 of file NodeList.cpp.
Node * NodeList::getNodeFromMAC | ( | const uint8_t * | mac | ) |
Gets node that correspond with given address.
mac | address to search for |
Definition at line 142 of file NodeList.cpp.
Node * NodeList::getNodeFromName | ( | const char * | name | ) |
Gets node that correspond with given node name.
name | Node name to search for |
Definition at line 174 of file NodeList.cpp.
|
inline |
Increments last broadcast message counter stata by one.
Definition at line 627 of file NodeList.h.
void NodeList::initBroadcastNode | ( | ) |
Init broadcast node data.
Definition at line 161 of file NodeList.cpp.
void NodeList::printToSerial | ( | Stream * | port | ) |
Dumps node list data to a Stream object.
port | Stram port |
Definition at line 340 of file NodeList.cpp.
bool NodeList::unregisterNode | ( | const uint8_t * | mac | ) |
Frees up a node and marks it as available.
mac | Address to free up |
Definition at line 270 of file NodeList.cpp.
bool NodeList::unregisterNode | ( | Node * | node | ) |
Frees up a node using a pointer to it.
node | Pointer to node instance |
Definition at line 281 of file NodeList.cpp.
bool NodeList::unregisterNode | ( | uint16_t | nodeId | ) |
Frees up a node and marks it as available.
nodeId | NodeId to free up |
Definition at line 258 of file NodeList.cpp.
|
protected |
Node instance that holds data used for broadcast messages. This does not represent any individual node.
Definition at line 633 of file NodeList.h.
|
protected |
Last broadcast message counter state for all nodes, both for data and control messages.
Definition at line 634 of file NodeList.h.
Static Node array that holds maximum number of supported nodes.
Definition at line 632 of file NodeList.h.