From b24866225a6301d3a663f874725e83c012dc25d3 Mon Sep 17 00:00:00 2001 From: Florent Duchon Date: Wed, 26 Dec 2012 17:36:00 +0100 Subject: digital/beacon: add bitcloud stack into common directory digital/zigbit --- .../Components/NWK/include/private/nwkLoopback.h | 87 ++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 digital/zigbit/bitcloud/stack/Components/NWK/include/private/nwkLoopback.h (limited to 'digital/zigbit/bitcloud/stack/Components/NWK/include/private/nwkLoopback.h') diff --git a/digital/zigbit/bitcloud/stack/Components/NWK/include/private/nwkLoopback.h b/digital/zigbit/bitcloud/stack/Components/NWK/include/private/nwkLoopback.h new file mode 100644 index 00000000..91710e26 --- /dev/null +++ b/digital/zigbit/bitcloud/stack/Components/NWK/include/private/nwkLoopback.h @@ -0,0 +1,87 @@ +/**************************************************************************//** + \file nwkLoopback.h + + \brief Interface of network loopback. + + \author + Atmel Corporation: http://www.atmel.com \n + Support email: avr@atmel.com + + Copyright (c) 2008-2011, Atmel Corporation. All rights reserved. + Licensed under Atmel's Limited License Agreement (BitCloudTM). + + \internal + History: + 2009-10-06 Max Gekk - Created. + Last change: + $Id: nwkLoopback.h 17923 2011-07-08 14:13:30Z mgekk $ + ******************************************************************************/ +#if !defined _NWK_LOOPBACK_H +#define _NWK_LOOPBACK_H + +/****************************************************************************** + Includes section + ******************************************************************************/ +#include +#include +#include + +/****************************************************************************** + Types section + ******************************************************************************/ +/** Internal states of the loopback component. */ +typedef enum _NwkLoopbackState_t +{ + NWK_LOOPBACK_UNKNOWN_STATE = 0x00, + NWK_LOOPBACK_FIRST_STATE = 0x8e, + NWK_LOOPBACK_IDLE_STATE = NWK_LOOPBACK_FIRST_STATE, + NWK_LOOPBACK_REQUEST_PROCESSING_STATE = 0x8f, + NWK_LOOPBACK_WAIT_PACKET_STATE = 0x90, + NWK_LOOPBACK_LAST_STATE +} NwkLoopbackState_t; + +/** Internal parameters of the loopback component. */ +typedef struct _NwkLoopback_t +{ + QueueDescriptor_t queue; /**< Queue of requests from upper layer */ + NwkLoopbackState_t state; /**< Finite-state machine */ +} NwkLoopback_t; + +/****************************************************************************** + Prototypes section + ******************************************************************************/ + +/**************************************************************************//** + \brief The main task handler of the network loopback component. + ******************************************************************************/ +NWK_PRIVATE void nwkLoopbackTaskHandler(void); + +/**************************************************************************//** + \brief Handler of free packet indication. + ******************************************************************************/ +NWK_PRIVATE void nwkLoopbackFreePacketInd(void); + +/**************************************************************************//** + \brief Reset the network loopback component. + ******************************************************************************/ +NWK_PRIVATE void nwkResetLoopback(void); + +/****************************************************************************** + \brief nwkLoopback idle checking. + + \return true, if nwkLoopback performs no activity, false - otherwise. + ******************************************************************************/ +NWK_PRIVATE bool nwkLoopbackIsIdle(void); + +/**************************************************************************//** + \brief Checks, if outgoing packet should be indicated to the next upper layer. + + \param[in] req - pointer to NLDE-DATA.request parameter's structure. + + \return True, if indication required, false - otherwise + ******************************************************************************/ +NWK_PRIVATE bool nwkLoopbackRequired(const NWK_DataReq_t *const req); + +#endif /* _NWK_LOOPBACK_H */ +/** nwkLoopback.h */ + -- cgit v1.2.3