Microchip® Advanced Software Framework

nwk.h File Reference

Network layer public interface.

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

#include <stdint.h>
#include <stdbool.h>
#include "sysConfig.h"
#include "nwkRoute.h"
#include "nwkGroup.h"
#include "nwkSecurity.h"
#include "nwkDataReq.h"

Data Structures

struct  NwkIb_t
 
#define NWK_MAX_PAYLOAD_SIZE
 
#define NWK_BROADCAST_PANID   0xffff
 
#define NWK_BROADCAST_ADDR   0xffff
 
#define NWK_ENDPOINTS_AMOUNT   16
 
enum  NWK_Status_t {
  NWK_SUCCESS_STATUS = 0x00,
  NWK_ERROR_STATUS = 0x01,
  NWK_OUT_OF_MEMORY_STATUS = 0x02,
  NWK_NO_ACK_STATUS = 0x10,
  NWK_NO_ROUTE_STATUS = 0x11,
  NWK_PHY_CHANNEL_ACCESS_FAILURE_STATUS = 0x20,
  NWK_PHY_NO_ACK_STATUS = 0x21
}
 
typedef struct NwkIb_t NwkIb_t
 
NwkIb_t nwkIb
 
void NWK_Init (void)
 Initializes all network layer modules. More...
 
void NWK_SetAddr (uint16_t addr)
 Sets network address of the node. More...
 
void NWK_SetPanId (uint16_t panId)
 Sets network identifier (PAN) of the node. More...
 
void NWK_OpenEndpoint (uint8_t id, bool(*handler)(NWK_DataInd_t *ind))
 Registers callback ind for the endpoint endpoint. More...
 
bool NWK_Busy (void)
 Checks if network layer is ready for sleep. More...
 
void NWK_Lock (void)
 Increases the lock counter and sets a busy state. More...
 
void NWK_Unlock (void)
 Decreases the lock counter and sets a free state if counter reaches 0. More...
 
void NWK_SleepReq (void)
 Puts network layer to a sleeping state. More...
 
void NWK_WakeupReq (void)
 Puts network layer to an active state. More...
 
void NWK_TaskHandler (void)
 Network layer task handler. More...
 
uint8_t NWK_LinearizeLqi (uint8_t lqi)
 Calculates linearized value for the given value of the LQI. More...