Microchip® Advanced Software Framework

nwkGroup.c File Reference

Multicast group management implementation.

Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.

#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include "sysConfig.h"

Macros

#define NWK_GROUP_FREE   0xffff
 

Functions

bool NWK_GroupAdd (uint16_t group)
 Adds node to the group. More...
 
bool NWK_GroupIsMember (uint16_t group)
 Verifies if node is a member of the group. More...
 
bool NWK_GroupRemove (uint16_t group)
 Removes node from the group. More...
 
void nwkGroupInit (void)
 Initializes the Group module. More...
 
static bool nwkGroupSwitch (uint16_t from, uint16_t to)
 Switches records with IDs from and to in the the group table. More...
 

Variables

static uint16_t nwkGroups [NWK_GROUPS_AMOUNT]
 

#define NWK_GROUP_FREE   0xffff

bool NWK_GroupAdd ( uint16_t  group)

Adds node to the group.

Parameters
[in]groupGroup ID
Returns
true in case of success and false otherwise

References NWK_GROUP_FREE, and nwkGroupSwitch().

Referenced by appCommandReceived().

bool NWK_GroupIsMember ( uint16_t  group)

Verifies if node is a member of the group.

Parameters
[in]groupGroup ID
Returns
true if node is a member of the group and false otherwise

References NWK_GROUPS_AMOUNT, and nwkGroups.

Referenced by nwkRouteDiscoveryRequestReceived(), nwkRoutePrepareTx(), and nwkRxHandleReceivedFrame().

bool NWK_GroupRemove ( uint16_t  group)

Removes node from the group.

Parameters
[in]groupGroup ID
Returns
true in case of success and false otherwise

References NWK_GROUP_FREE, and nwkGroupSwitch().

Referenced by appCommandReceived().

void nwkGroupInit ( void  )

Initializes the Group module.

References NWK_GROUP_FREE, NWK_GROUPS_AMOUNT, and nwkGroups.

Referenced by NWK_Init().

static bool nwkGroupSwitch ( uint16_t  from,
uint16_t  to 
)
static

Switches records with IDs from and to in the the group table.

Parameters
[in]fromSource group ID
[in]toDestination group ID
Returns
true if from entry was found and false otherwise

References NWK_GROUPS_AMOUNT, and nwkGroups.

Referenced by NWK_GroupAdd(), and NWK_GroupRemove().

uint16_t nwkGroups[NWK_GROUPS_AMOUNT]
static