Atmel Software Framework

nwkRx.c File Reference

Receive routines implementation.

Copyright (C) 2014-2015 Atmel Corporation. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. The name of Atmel may not be used to endorse or promote products derived from this software without specific prior written permission.
  4. This software may only be redistributed and used in connection with an Atmel microcontroller product.

THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#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)
 
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
Value:
#define NWK_RX_DUPLICATE_REJECTION_TIMER_INTERVAL
Definition: nwkRx.c:67
#define NWK_DUPLICATE_REJECTION_TTL
Definition: config_gen.h:8

Referenced by nwkRxRejectDuplicate().

#define NWK_RX_DUPLICATE_REJECTION_TIMER_INTERVAL   100 /* ms */

Referenced by nwkRxInit().

#define NWK_SERVICE_ENDPOINT_ID   0

Referenced by nwkRxInit().

anonymous enum
Enumerator
NWK_RX_STATE_RECEIVED 
NWK_RX_STATE_DECRYPT 
NWK_RX_STATE_INDICATE 
NWK_RX_STATE_ROUTE 
NWK_RX_STATE_FINISH 

void NWK_SetAckControl ( uint8_t  control)

References nwkRxAckControl.

Referenced by appDataInd().

static void nwkRxDuplicateRejectionTimerHandler ( SYS_Timer_t timer)
static

uint8_t nwkRxAckControl
static
SYS_Timer_t nwkRxDuplicateRejectionTimer
static