summaryrefslogtreecommitdiffhomepage
path: root/digital/zigbit/bitcloud/stack/Components/NWK/include/private/nwkSilentJoin.h
blob: 430dc08ddbdbb869b0198c01d9d0d99f934fc315 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*************************************************************************//**
  \file nwkSilentJoin.h

  \brief Interface of silent join functionality.

  \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:
    2011-03-17 A. Taradov - Created.
   Last change:
    $Id: nwkOrphan.h 15388 2011-02-20 23:55:47Z mgekk $
 ******************************************************************************/
#if !defined _NWK_SILENT_JOIN_H
#define _NWK_SILENT_JOIN_H

/******************************************************************************
                                Includes section
 ******************************************************************************/
#include <nwkConfig.h>
#include <queue.h>
#include <nlmeJoin.h>
#include <macSetGet.h>
#include <macRxEnable.h>

/******************************************************************************
                                 Types section
 ******************************************************************************/
typedef enum
{
  NWK_SILENT_JOIN_STATE_MIN = 0x15,
  NWK_SILENT_JOIN_STATE_IDLE,
  NWK_SILENT_JOIN_STATE_REQUEST_QUEUED,
  NWK_SILENT_JOIN_STATE_SET_PARAMS,
  NWK_SILENT_JOIN_STATE_MAX
} NwkSilentJoinState_t;

/** Silent join memory */
typedef struct _NwkSilentJoin_t
{
  NwkSilentJoinState_t state;

#if defined _ROUTER_ || defined _ENDDEVICE_
  /** Request queue */
  QueueDescriptor_t queue;
#endif

#if defined _ROUTER_ || defined _ENDDEVICE_
  /** Memory for mac requests */
  union
  {
    MAC_SetReq_t set;
    MAC_RxEnableReq_t rxEnable;
  } req;
#endif
} NwkSilentJoin_t;

/******************************************************************************
                             Prototypes section
 ******************************************************************************/
#if (defined(_ROUTER_) || defined(_ENDDEVICE_)) && defined(_NWK_SILENT_JOIN_)
/**************************************************************************//**
  \brief Silent join module reset.
 ******************************************************************************/
NWK_PRIVATE void nwkResetSilentJoin(void);

/**************************************************************************//**
  \brief Main task handler of the silent join module.
 ******************************************************************************/
NWK_PRIVATE void nwkSilentJoinTaskHandler(void);

/**************************************************************************//**
  \brief Process silent join requests.

  \param[in] req - NLME-JOIN request parameters' structure pointer.
  \return None.
 ******************************************************************************/
NWK_PRIVATE void nwkSilentJoinReq(NWK_JoinReq_t *req);

#else

#define nwkResetSilentJoin() (void)0
#define nwkSilentJoinTaskHandler NULL

#endif /* (_ROUTER_ or _ENDDEVICE_) and _NWK_SILENT_JOIN_ */
#endif /* _NWK_SILENT_JOIN_H */

/** eof nwkSilentJoin.h */