NodeMask#

Typedefs#

typedef uint8_t
NODE_MASK_TYPE[MAX_NODEMASK_LENGTH]
typedef uint8_t
LR_NODE_MASK_TYPE[MAX_LR_NODEMASK_LENGTH]

Functions#

void
ZW_NodeMaskSetBit(uint8_t *pMask, node_id_t bNodeID)
void
ZW_NodeMaskClearBit(uint8_t *pMask, node_id_t bNodeID)

Clear the node bit in a node bitmask.

void
ZW_NodeMaskClear(uint8_t *pMask, uint8_t bLength)

Clear all bits in a nodemask.

uint8_t
ZW_NodeMaskBitsIn(const uint8_t *pMask, uint8_t bLength)

Check and count number of bit that is set in a nodemask.

uint8_t
ZW_NodeMaskNodeIn(const uint8_t *pMask, node_id_t bNode)

Check if a node is in a nodemask.

ZW_NodeMaskGetNextNodeIndex(node_id_t currentNodeIndex, uint8_t *pMask)

Find the next NodeIndex that is set in a nodemask WARNING: this function is the only one working with indexes and not node IDs.

Macros#

#define
NODEMASK_NODES_PER_BYTE 8

Number of nodes per node mask byte.

#define
MAX_NODEMASK_LENGTH (ZW_MAX_NODES/NODEMASK_NODES_PER_BYTE)

Max length of a node mask.

#define
MAX_LR_NODEMASK_LENGTH (ZW_MAX_NODES_LR/NODEMASK_NODES_PER_BYTE)

Max length of Long Range node mask.

Typedef Documentation#

NODE_MASK_TYPE#

typedef uint8_t NODE_MASK_TYPE[MAX_NODEMASK_LENGTH] [MAX_NODEMASK_LENGTH]

LR_NODE_MASK_TYPE#

typedef uint8_t LR_NODE_MASK_TYPE[MAX_LR_NODEMASK_LENGTH] [MAX_LR_NODEMASK_LENGTH]

Function Documentation#

ZW_NodeMaskSetBit#

void ZW_NodeMaskSetBit (uint8_t * pMask, node_id_t bNodeID)
Parameters
TypeDirectionArgument NameDescription
uint8_t *N/ApMask
node_id_tN/AbNodeID

ZW_NodeMaskClearBit#

void ZW_NodeMaskClearBit (uint8_t * pMask, node_id_t bNodeID)

Clear the node bit in a node bitmask.

Parameters
TypeDirectionArgument NameDescription
uint8_t *N/ApMask

Pointer to Nodemask list that should be set

node_id_tN/AbNodeID

Node to set in nodemask


ZW_NodeMaskClear#

void ZW_NodeMaskClear (uint8_t * pMask, uint8_t bLength)

Clear all bits in a nodemask.

Parameters
TypeDirectionArgument NameDescription
uint8_t *N/ApMask

Pointer to Nodemask list that should be cleared

uint8_tN/AbLength

Length of nodemask to be cleared


ZW_NodeMaskBitsIn#

uint8_t ZW_NodeMaskBitsIn (const uint8_t * pMask, uint8_t bLength)

Check and count number of bit that is set in a nodemask.

Parameters
TypeDirectionArgument NameDescription
const uint8_t *N/ApMask

Pointer to nodemask that should be counted

uint8_tN/AbLength

Length of nodemask to count

Returns

  • Number of bits set in nodemask


ZW_NodeMaskNodeIn#

uint8_t ZW_NodeMaskNodeIn (const uint8_t * pMask, node_id_t bNode)

Check if a node is in a nodemask.

Parameters
TypeDirectionArgument NameDescription
const uint8_t *N/ApMask

Pointer to nodemask to check for bNode

node_id_tN/AbNode

Bit number that should be checked

Returns

  • 0 if not in nodemask, non-zero if found in nodemask


ZW_NodeMaskGetNextNodeIndex#

node_id_t ZW_NodeMaskGetNextNodeIndex (node_id_t currentNodeIndex, uint8_t * pMask)

Find the next NodeIndex that is set in a nodemask WARNING: this function is the only one working with indexes and not node IDs.

Parameters
TypeDirectionArgument NameDescription
node_id_tN/AcurrentNodeIndex

Last NodeId found (0 for first call)

uint8_t *N/ApMask

Pointer to Nodemask list that should be searched

Returns

  • Next NodeId from the nodemask if found, or 0 if not found.