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 --- .../stack/Components/NWK/include/private/nwkSync.h | 92 ++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 digital/zigbit/bitcloud/stack/Components/NWK/include/private/nwkSync.h (limited to 'digital/zigbit/bitcloud/stack/Components/NWK/include/private/nwkSync.h') diff --git a/digital/zigbit/bitcloud/stack/Components/NWK/include/private/nwkSync.h b/digital/zigbit/bitcloud/stack/Components/NWK/include/private/nwkSync.h new file mode 100644 index 00000000..75bf12c1 --- /dev/null +++ b/digital/zigbit/bitcloud/stack/Components/NWK/include/private/nwkSync.h @@ -0,0 +1,92 @@ +/**************************************************************************//** + \file nwkSync.h + + \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: + 2007-06-27 V. Panov - Created. + 2008-12-10 M. Gekk - Reduction of usage of the RAM at separate compiling. + 2009-03-10 M. Gekk - Refactoring. + Last change: + $Id: nwkSync.h 17448 2011-06-09 13:53:59Z ataradov $ + ******************************************************************************/ +#if !defined _NWK_SYNC_H +#define _NWK_SYNC_H + +/***************************************************************************** + Includes section + *****************************************************************************/ +#include +#include +#include + +/****************************************************************************** + Definitions section + ******************************************************************************/ +/** Maximum synchronization attempts. */ +#define MAX_SYNC_FAIL_COUNTER 8U + +/****************************************************************************** + Types section + ******************************************************************************/ +/** Internal states of NLME-SYNC component */ +typedef enum _NwkSyncState_t +{ + NWK_SYNC_IDLE_STATE = 0x31, + NWK_SYNC_FIRST_STATE = 0xA3, + NWK_SYNC_BEGIN_STATE = NWK_SYNC_FIRST_STATE, + NWK_SYNC_MAC_POLL_STATE = 0xA4, + NWK_SYNC_CONFIRM_STATE = 0xA5, + NWK_SYNC_LAST_STATE +} NwkSyncState_t; + +/** Internal parameters of NLME-SYNC component. */ +typedef struct _NwkSync_t +{ + /** Internal component's state*/ + NwkSyncState_t state; + /** Counter of synchronization attempts */ + uint8_t counter; + /** Queue of NLME-SYNC.request from an upper layer */ + QueueDescriptor_t queue; + /** MLME-POLL request primitive's parameters */ + MAC_PollReq_t macReq; /**< macReq must be no in union */ +} NwkSync_t; + +/***************************************************************************** + Prototypes section + *****************************************************************************/ +#if defined _ENDDEVICE_ +/*************************************************************************//** + \brief Main task handler of NLME-SYNC component + *****************************************************************************/ +NWK_PRIVATE void nwkSyncTaskHandler(void); + +/*************************************************************************//** + \brief Reset NLME-SYNC component. + *****************************************************************************/ +NWK_PRIVATE void nwkResetSync(void); + +/****************************************************************************** + \brief nwkSync idle checking. + + \return true, if nwkSync performs no activity, false - otherwise. + ******************************************************************************/ +NWK_PRIVATE bool nwkSyncIsIdle(void); + +#else /* _ENDDEVICE_ */ + +#define nwkSyncTaskHandler NULL +#define nwkSyncIsIdle NULL +#define nwkResetSync() (void)0 + +#endif /* _ENDDEVICE_ */ +#endif /* _NWK_SYNC_H */ +/** eof nwkSync.h */ + -- cgit v1.2.3