summaryrefslogtreecommitdiff
path: root/digital/zigbit/bitcloud/stack/Components/NWK/include/private/nwkConcentrator.h
blob: 65e5a4a0e2818cf661cf3cba98fa28d60901cf0d (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
/**************************************************************************//**
  \file nwkConcentrator.h

  \brief Interface of network concentrator.

  \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-09-14 Max Gekk - Created.
   Last change:
    $Id: nwkConcentrator.h 17448 2011-06-09 13:53:59Z ataradov $
 ******************************************************************************/
#if !defined _NWK_CONCENTRATOR_H
#define _NWK_CONCENTRATOR_H

/******************************************************************************
                               Includes section
 ******************************************************************************/
#include <nwkConfig.h>
#include <appTimer.h>
#include <nlmeRouteDiscovery.h>

/******************************************************************************
                                 Types section
 ******************************************************************************/
/** Internal states of the network concentrator. */
typedef enum _NwkConcentratorState_t
{
  NWK_CONCENTRATOR_IDLE_STATE = 0x89,
  NWK_CONCENTRATOR_FIRST_STATE = 0x8A,
  NWK_CONCENTRATOR_START_TIMER_STATE = NWK_CONCENTRATOR_FIRST_STATE,
  NWK_CONCENTRATOR_ROUTE_DISCOVERY_STATE = 0x8B,
  NWK_CONCENTRATOR_LAST_STATE
} NwkConcentratorState_t;

/** State and parameters of the network concentrator. */
typedef struct _NwkConcentrator_t
{
  NwkConcentratorState_t state;
  union
  {
    HAL_AppTimer_t timer;
    NWK_RouteDiscoveryReq_t routeDiscovery;
  } req;
} NwkConcentrator_t;

/******************************************************************************
                               Prototypes section
 ******************************************************************************/
#if defined _NWK_CONCENTRATOR_
/**************************************************************************//**
  \brief Start the network concentrator.

    Periodic sending of route discovery commands.
 ******************************************************************************/
NWK_PRIVATE void nwkStartConcentrator(void);

/**************************************************************************//**
  \brief nwkReset module call this function when network layer is reseting.
 ******************************************************************************/
NWK_PRIVATE void nwkResetConcentrator(void);

/**************************************************************************//**
  \brief Check state of the concentrator and stop timer.
 ******************************************************************************/
NWK_PRIVATE void nwkStopConcentratorTimer(void);

#else /* _NWK_CONCENTRATOR_ */

#define nwkStartConcentrator() (void)0
#define nwkStopConcentratorTimer()  (void)0
#define nwkResetConcentrator() (void)0

#endif /* _NWK_CONCENTRATOR_ */
#endif /* _NWK_CONCENTRATOR_H */
/** eof nwkConcentrator.h */