Receive routines implementation.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include "phy.h"
#include "sysConfig.h"
#include "sysTimer.h"
#include "nwk.h"
#include "nwkTx.h"
#include "nwkFrame.h"
#include "nwkGroup.h"
#include "nwkRoute.h"
#include "nwkCommand.h"
#include "nwkSecurity.h"
#include "nwkRouteDiscovery.h"
Data Structures | |
struct | NwkDuplicateRejectionEntry_t |
Macros | |
#define | DUPLICATE_REJECTION_TTL |
#define | NWK_RX_DUPLICATE_REJECTION_TIMER_INTERVAL 100 /* ms */ |
#define | NWK_SERVICE_ENDPOINT_ID 0 |
Typedefs | |
typedef struct NwkDuplicateRejectionEntry_t | NwkDuplicateRejectionEntry_t |
Enumerations | |
enum | { NWK_RX_STATE_RECEIVED = 0x20, NWK_RX_STATE_DECRYPT = 0x21, NWK_RX_STATE_INDICATE = 0x22, NWK_RX_STATE_ROUTE = 0x23, NWK_RX_STATE_FINISH = 0x24 } |
Functions | |
void | NWK_SetAckControl (uint8_t control) |
void | nwkRxDecryptConf (NwkFrame_t *frame, bool status) |
static void | nwkRxDuplicateRejectionTimerHandler (SYS_Timer_t *timer) |
static void | nwkRxHandleIndication (NwkFrame_t *frame) |
static void | nwkRxHandleReceivedFrame (NwkFrame_t *frame) |
static bool | nwkRxIndicateFrame (NwkFrame_t *frame) |
void | nwkRxInit (void) |
Initializes the Rx module. More... | |
static bool | nwkRxRejectDuplicate (NwkFrameHeader_t *header) |
static void | nwkRxSendAck (NwkFrame_t *frame) |
static bool | nwkRxSeriveDataInd (NWK_DataInd_t *ind) |
void | nwkRxTaskHandler (void) |
Rx Module task handler. More... | |
void | PHY_DataInd (PHY_DataInd_t *ind) |
Variables | |
static uint8_t | nwkRxAckControl |
static NwkDuplicateRejectionEntry_t | nwkRxDuplicateRejectionTable [NWK_DUPLICATE_REJECTION_TABLE_SIZE] |
static SYS_Timer_t | nwkRxDuplicateRejectionTimer |
#define DUPLICATE_REJECTION_TTL |
Referenced by nwkRxRejectDuplicate().
#define NWK_RX_DUPLICATE_REJECTION_TIMER_INTERVAL 100 /* ms */ |
Referenced by nwkRxInit().
#define NWK_SERVICE_ENDPOINT_ID 0 |
Referenced by nwkRxInit().
typedef struct NwkDuplicateRejectionEntry_t NwkDuplicateRejectionEntry_t |
anonymous enum |
void NWK_SetAckControl | ( | uint8_t | control | ) |
References nwkRxAckControl.
Referenced by appDataInd().
void nwkRxDecryptConf | ( | NwkFrame_t * | frame, |
bool | status | ||
) |
References NWK_RX_STATE_FINISH, NWK_RX_STATE_INDICATE, and NwkFrame_t::state.
Referenced by nwkSecurityTaskHandler().
|
static |
References NWK_DUPLICATE_REJECTION_TABLE_SIZE, SYS_TimerStart(), and NwkDuplicateRejectionEntry_t::ttl.
Referenced by nwkRxInit().
|
static |
References NwkFrameHeader_t::ackRequest, NwkIb_t::addr, NwkFrame_t::header, NwkFrameHeader_t::macDstAddr, NwkFrameHeader_t::macDstPanId, NwkFrameHeader_t::multicast, NWK_BROADCAST_ADDR, NWK_BROADCAST_PANID, NWK_RX_STATE_FINISH, NwkFrameHeader_t::nwkDstAddr, NwkFrameHeader_t::nwkFcf, nwkIb, nwkRxAckControl, nwkRxIndicateFrame(), nwkRxSendAck(), and NwkFrame_t::state.
Referenced by nwkRxTaskHandler().
|
static |
References NwkFrameHeader_t::ackRequest, NwkIb_t::addr, NwkFrame_t::header, NwkFrameHeader_t::linkLocal, NwkFrameHeader_t::macDstAddr, NwkFrameHeader_t::macDstPanId, NwkFrameHeader_t::macSrcAddr, NwkFrameMulticastHeader_t::maxMemberRadius, NwkFrameMulticastHeader_t::maxNonMemberRadius, NwkFrameMulticastHeader_t::memberRadius, NwkFrameHeader_t::multicast, NwkFrameMulticastHeader_t::nonMemberRadius, NWK_BROADCAST_ADDR, NWK_BROADCAST_PANID, NWK_RX_STATE_DECRYPT, NWK_RX_STATE_FINISH, NWK_RX_STATE_INDICATE, NWK_RX_STATE_ROUTE, NwkFrameHeader_t::nwkDstAddr, NwkFrameHeader_t::nwkFcf, nwkIb, nwkRouteFrameReceived(), nwkRxRejectDuplicate(), NwkFrameHeader_t::nwkSrcAddr, nwkTxBroadcastFrame(), NwkFrame_t::payload, NwkFrame_t::rx, NwkFrameHeader_t::security, and NwkFrame_t::state.
Referenced by nwkRxTaskHandler().
|
static |
References NwkFrameHeader_t::ackRequest, NWK_DataInd_t::data, NWK_DataInd_t::dstAddr, NWK_DataInd_t::dstEndpoint, NwkIb_t::endpoint, NwkFrame_t::header, NwkFrameHeader_t::linkLocal, NWK_DataInd_t::lqi, NwkFrameHeader_t::macDstPanId, NwkFrameHeader_t::macSrcAddr, NwkFrameHeader_t::multicast, NWK_BROADCAST_ADDR, NWK_BROADCAST_PANID, NWK_IND_OPT_ACK_REQUESTED, NWK_IND_OPT_BROADCAST, NWK_IND_OPT_BROADCAST_PAN_ID, NWK_IND_OPT_LINK_LOCAL, NWK_IND_OPT_LOCAL, NWK_IND_OPT_MULTICAST, NWK_IND_OPT_SECURED, NwkFrameHeader_t::nwkDstAddr, NwkFrameHeader_t::nwkDstEndpoint, NwkFrameHeader_t::nwkFcf, nwkFramePayloadSize(), nwkIb, NwkFrameHeader_t::nwkSrcAddr, NwkFrameHeader_t::nwkSrcEndpoint, NWK_DataInd_t::options, NwkFrame_t::payload, NWK_DataInd_t::rssi, NwkFrame_t::rx, NwkFrameHeader_t::security, NWK_DataInd_t::size, NWK_DataInd_t::srcAddr, and NWK_DataInd_t::srcEndpoint.
Referenced by nwkRxHandleIndication().
void nwkRxInit | ( | void | ) |
Initializes the Rx module.
References SYS_Timer_t::handler, SYS_Timer_t::interval, SYS_Timer_t::mode, NWK_DUPLICATE_REJECTION_TABLE_SIZE, NWK_OpenEndpoint(), NWK_RX_DUPLICATE_REJECTION_TIMER_INTERVAL, NWK_SERVICE_ENDPOINT_ID, nwkRxDuplicateRejectionTimerHandler(), nwkRxSeriveDataInd(), SYS_TIMER_INTERVAL_MODE, and NwkDuplicateRejectionEntry_t::ttl.
Referenced by NWK_Init().
|
static |
References NwkIb_t::addr, DUPLICATE_REJECTION_TTL, NwkFrameHeader_t::macDstAddr, NwkDuplicateRejectionEntry_t::mask, NwkFrameHeader_t::multicast, NWK_DUPLICATE_REJECTION_TABLE_SIZE, NwkFrameHeader_t::nwkDstAddr, NwkFrameHeader_t::nwkFcf, nwkIb, nwkRouteRemove(), NwkFrameHeader_t::nwkSeq, NwkFrameHeader_t::nwkSrcAddr, NwkDuplicateRejectionEntry_t::seq, NwkDuplicateRejectionEntry_t::src, SYS_TimerStart(), and NwkDuplicateRejectionEntry_t::ttl.
Referenced by nwkRxHandleReceivedFrame().
|
static |
References NwkCommandAck_t::control, NwkFrame_t::header, NwkCommandAck_t::id, NWK_COMMAND_ACK, NwkFrameHeader_t::nwkDstAddr, NwkFrameHeader_t::nwkFcf, nwkFrameAlloc(), nwkFrameCommandInit(), nwkRxAckControl, NwkFrameHeader_t::nwkSeq, NwkFrameHeader_t::nwkSrcAddr, nwkTxFrame(), NwkFrame_t::payload, NwkFrameHeader_t::security, NwkCommandAck_t::seq, NwkFrame_t::size, and NwkFrame_t::tx.
Referenced by nwkRxHandleIndication().
|
static |
References NWK_DataInd_t::data, NWK_COMMAND_ACK, NWK_COMMAND_ROUTE_ERROR, NWK_COMMAND_ROUTE_REPLY, NWK_COMMAND_ROUTE_REQUEST, NWK_IND_OPT_SECURED, nwkRouteDiscoveryReplyReceived(), nwkRouteDiscoveryRequestReceived(), nwkRouteErrorReceived(), nwkTxAckReceived(), NWK_DataInd_t::options, and NWK_DataInd_t::size.
Referenced by nwkRxInit().
void nwkRxTaskHandler | ( | void | ) |
Rx Module task handler.
References NWK_RX_STATE_DECRYPT, NWK_RX_STATE_FINISH, NWK_RX_STATE_INDICATE, NWK_RX_STATE_RECEIVED, NWK_RX_STATE_ROUTE, nwkFrameFree(), nwkFrameNext(), nwkRouteFrame(), nwkRxHandleIndication(), nwkRxHandleReceivedFrame(), nwkSecurityProcess(), and NwkFrame_t::state.
Referenced by NWK_TaskHandler().
void PHY_DataInd | ( | PHY_DataInd_t * | ind | ) |
References PHY_DataInd_t::data, NwkFrame_t::data, PHY_DataInd_t::lqi, NWK_RX_STATE_RECEIVED, nwkFrameAlloc(), PHY_DataInd_t::rssi, NwkFrame_t::rx, PHY_DataInd_t::size, NwkFrame_t::size, and NwkFrame_t::state.
Referenced by PHY_TaskHandler().
|
static |
Referenced by NWK_SetAckControl(), nwkRxHandleIndication(), and nwkRxSendAck().
|
static |
|
static |