summaryrefslogtreecommitdiff
path: root/digital/zigbit/bitcloud/stack/Components/NWK/include/private/nwkAddressConflict.h
diff options
context:
space:
mode:
authorFlorent Duchon2012-12-26 17:36:00 +0100
committerFlorent Duchon2013-02-13 21:21:12 +0100
commitb24866225a6301d3a663f874725e83c012dc25d3 (patch)
treeca527a2aab9abcdfbaf244c53ca63f0c531892b0 /digital/zigbit/bitcloud/stack/Components/NWK/include/private/nwkAddressConflict.h
parent2ba279f4eb2f23fa08a7c13465d16ae6ba5d0f96 (diff)
digital/beacon: add bitcloud stack into common directory digital/zigbit
Diffstat (limited to 'digital/zigbit/bitcloud/stack/Components/NWK/include/private/nwkAddressConflict.h')
-rw-r--r--digital/zigbit/bitcloud/stack/Components/NWK/include/private/nwkAddressConflict.h105
1 files changed, 105 insertions, 0 deletions
diff --git a/digital/zigbit/bitcloud/stack/Components/NWK/include/private/nwkAddressConflict.h b/digital/zigbit/bitcloud/stack/Components/NWK/include/private/nwkAddressConflict.h
new file mode 100644
index 00000000..7b349907
--- /dev/null
+++ b/digital/zigbit/bitcloud/stack/Components/NWK/include/private/nwkAddressConflict.h
@@ -0,0 +1,105 @@
+/**************************************************************************//**
+ \file nwkAddressConflict.h
+
+ \brief Interface of address conflict resolver.
+
+ \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-06-23 Max Gekk - Created.
+ 2010-07-04 Max Gekk - Redesign.
+ Last change:
+ $Id: nwkAddressConflict.h 17448 2011-06-09 13:53:59Z ataradov $
+ ******************************************************************************/
+#if !defined _NWK_ADDRESS_CONFLICT_H
+#define _NWK_ADDRESS_CONFLICT_H
+
+/******************************************************************************
+ Includes section
+ ******************************************************************************/
+#include <nwkConfig.h>
+#include <types.h>
+#include <queue.h>
+#include <mac.h>
+#include <nwkCommon.h>
+#include <nlmeJoin.h>
+#include <nwkStatusReq.h>
+
+/******************************************************************************
+ Types section
+ ******************************************************************************/
+/** Internal states of the address conflict component. */
+typedef enum _NwkAddrConflictState_t
+{
+ NWK_ADDR_CONFLICT_IDLE_STATE = 0xAA,
+ NWK_ADDR_CONFLICT_FIRST_STATE = 0x43,
+ NWK_ADDR_CONFLICT_BEGIN_STATE = NWK_ADDR_CONFLICT_FIRST_STATE,
+ NWK_ADDR_CONFLICT_MAC_SET_STATE = 0x44,
+ NWK_ADDR_CONFLICT_REJOIN_STATE = 0x45,
+ NWK_ADDR_CONFLICT_SEND_STATUS_STATE = 0x46,
+ NWK_ADDR_CONFLICT_LAST_STATE
+} NwkAddrConflictState_t;
+
+/** Internal variables of the network manager component. */
+typedef struct _NwkAddrConflict_t
+{
+ /** Finite-state machine */
+ NwkAddrConflictState_t state;
+ /** Current conflict address. */
+ ShortAddr_t shortAddr;
+ bool sendNwkStatus;
+ union
+ {
+ MAC_SetReq_t macSet;
+ NWK_JoinReq_t rejoin;
+ NwkStatusReq_t nwkStatus;
+ } req;
+} NwkAddrConflict_t;
+
+/******************************************************************************
+ Prototypes section
+ ******************************************************************************/
+#if defined _RESOLVE_ADDR_CONFLICT_
+/**************************************************************************//**
+ \brief Reset address conflict component.
+ ******************************************************************************/
+NWK_PRIVATE void nwkResetAddressConflict(void);
+
+/**************************************************************************//**
+ \brief Main task handler of address conflict component.
+ ******************************************************************************/
+NWK_PRIVATE void nwkAddressConflictTaskHandler(void);
+
+/**************************************************************************//**
+ \brief Resolve address conflict for given short address.
+
+ \param[in] shortAddr - conflicted short address.
+ \return None.
+******************************************************************************/
+NWK_PRIVATE void nwkResolveAddressConflict(const ShortAddr_t shortAddr,
+ const bool sendNwkStatus);
+
+/******************************************************************************
+ \brief nwkAddressConflict idle checking.
+
+ \return true, if nwkAddressConflict performs no activity, false - otherwise.
+ ******************************************************************************/
+NWK_PRIVATE bool nwkAddressConflictIsIdle(void);
+
+#else /* _RESOLVE_ADDR_CONFLICT_ */
+
+#define nwkResetAddressConflict() (void)0
+#define nwkAddressConflictTaskHandler NULL
+#define nwkAddressConflictIsIdle NULL
+#define nwkResolveAddressConflict(shortAddr, sendNwkStatus) ((void)0)
+
+#endif /* _RESOLVE_ADDR_CONFLICT_ */
+#endif /* _NWK_ADDRESS_CONFLICT_H */
+/** eof nwkAddressConflict.h */
+