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

  \brief Network route discovery header file.

  \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-09-05 V. Panov - Created.
    2008-09-06 M. Gekk  - Modified to support parallel processing.
    2010-02-06 M. Gekk  - Refactoring.
   Last change:
    $Id: nwkRouteDiscovery.h 17448 2011-06-09 13:53:59Z ataradov $
 ******************************************************************************/
#if !defined _NWK_ROUTE_DISCOVERY_H
#define _NWK_ROUTE_DISCOVERY_H

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

/******************************************************************************
                                 Types section
 ******************************************************************************/
/** Internal states of the route discovery component. */
typedef enum _NwkRouteDiscoveryState_t
{
  NWK_ROUTE_DISCOVERY_IDLE_STATE = 0x99,
  NWK_ROUTE_DISCOVERY_PROCESS_STATE = 0x38
} NwkRouteDiscoveryState_t;

/** Internal state and variables of route discovery component. */
typedef struct _NwkRouteDiscovery_t
{
  QueueDescriptor_t queue;  /**< Queue of requests from other components. */
  /** Identifier of initial route request. */
  NwkRouteRequestId_t routeRequestId;
#if defined _SYS_ASSERT_ON_
  /** Finite-state machine. */
  NwkRouteDiscoveryState_t state;
#endif /* _SYS_ASSERT_ON_ */
} NwkRouteDiscovery_t;

/******************************************************************************
                                Prototypes section
 ******************************************************************************/
#if defined NWK_ROUTING_CAPACITY \
  && (defined _NWK_MESH_ROUTING_ || defined _NWK_CONCENTRATOR_)
/**************************************************************************//**
  \brief Task handler of the route discovery component.
 ******************************************************************************/
NWK_PRIVATE void nwkRouteDiscoveryTaskHandler(void);

/******************************************************************************
  \brief Reset the route discovery component.
 ******************************************************************************/
NWK_PRIVATE void nwkResetRouteDiscovery(void);

/******************************************************************************
  \brief Flush all route discovery requests.
 ******************************************************************************/
NWK_PRIVATE void nwkFlushRouteDiscovery(void);

/******************************************************************************
  \brief nwkRouteDiscovery idle checking.

  \return true, if nwkRouteDiscovery performs no activity, false - otherwise.
 ******************************************************************************/
NWK_PRIVATE bool nwkRouteDiscoveryIsIdle(void);

#else /* no NWK_ROUTING_CAPACITY */

#define nwkRouteDiscoveryTaskHandler NULL
#define nwkRouteDiscoveryIsIdle NULL
#define nwkResetRouteDiscovery() (void)0
#define nwkFlushRouteDiscovery() (void)0

#endif /* NWK_ROUTING_CAPACITY and (_NWK_MESH_ROUTING_ or _NWK_CONCENTRATOR_) */
#endif /* _NWK_ROUTE_DISCOVERY_H */
/** eof nwkRouteDiscovery.h */