summaryrefslogtreecommitdiff
path: root/digital/zigbit/bitcloud/stack/Components/NWK/include/nlmeNetworkDiscovery.h
blob: b8d45646413cad0fc812782bb7cc8df122a478fd (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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/**************************************************************************//**
  \file nlmeNetworkDiscovery.h

  \brief NLME-NETWORK-DISCOVERY interface

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

/******************************************************************************
                               Includes section
 ******************************************************************************/
#include <types.h>
#include <mac.h>
#include <nwkCommon.h>
#include <appFramework.h>

/******************************************************************************
                                Types section
 ******************************************************************************/
/**//**
 * \brief Network Descriptor Information Fields.
 * */
BEGIN_PACK
typedef struct PACK _NWK_NetworkDescriptor_t
{
  /** The 64-bit PAN identifier of the network. */
  ExtPanId_t extendedPANId;
  /** The current logical channel occupied by the network. */
  Channel_t logicalChannel;
  /** A ZigBee stack profile identifier indicating the stack profile in use in
   * the discovered network. */
  StackProfile_t stackProfile;
  /** The version of the ZigBee protocol in use in the discovered network. */
  uint8_t zigBeeVersion;
  /** This specifies how often the MAC sub-layer beacon is to be transmitted by
   * a given device on the network. */
  BeaconOrder_t beaconOrder;
  /** For beacon-oriented networks, that is, beacon order < 15, this specifies
   * the length of the active period of the superframe. */
  BeaconOrder_t superframeOrder;
  /** A value of '1' indicates that at least one ZigBee router on the network
   * currently permits joining, i.e. its NWK has been issued an NLME-PERMIT-JOINING
   * primitive and, the time limit if given, has not yet expired. */
  bool permitJoining;
  /** This value is set to '1' if the device s capable of accepting join
   * requests from router-capable devices and set to '0' otherwise. */
  bool routerCapacity;
  /** This value is set to '1' if the device is capable of accepting join
   * requests from end devices and set to '0' otherwise. */
  bool endDeviceCapacity;
} NWK_NetworkDescriptor_t;
END_PACK

/**//**
 * \brief NLME-NETWORK-DISCOVERY confirm primitive's parameters structure.
 * ZigBee Specification r17, 3.2.2.2, NLME-NETWORK-DISCOVERY.confirm
 */
typedef struct _NWK_NetworkDiscoveryConf_t
{
  /** The status of the request. Any status values returned with MLME-SCAN.confirm
   * primitive or NWK_INVALID_REQUEST_STATUS, NWK_SUCCESS_STATUS. */
  NWK_Status_t status;
  /** The number of networks discovered by the search. */
  uint8_t networkCount;
  /** Size of networkDescriptors array. It must be initialized by user.
   * Zero value is admissible. */
  uint8_t maxNetworkDescr;
  /** The array of descriptors, one for each of the networks discovered.
   * It must be initialized by user. NULL pointer is admissible. */
  NWK_NetworkDescriptor_t *networkDescriptors;
} NWK_NetworkDiscoveryConf_t;

/**//**
 * \brief NLME-NETWORK-DISCOVERY request primitive's parameters structure.
 * Zigbee Specification r17, 3.2.2.1 NLME-NETWORK-DISCOVERY.request.
 */
typedef struct _NWK_NetworkDiscoveryReq_t
{
  /** Service fields - for internal needs. */
  struct
  {
    QueueElement_t qelem; /**< link used for queuing */
    MAC_ScanReq_t macScan;
  } service;
  /** A value used to calculate the length of time to spend scanning each channel. */
  ScanDuration_t scanDuration;
  /** The mask of channels that must be scanned. */
  ChannelsMask_t scanChannels;
  /** NLME-NETWORK-DISCOVERY confirm callback function's pointer. */
  void (*NWK_NetworkDiscoveryConf)(NWK_NetworkDiscoveryConf_t *conf);
  NWK_NetworkDiscoveryConf_t confirm;
  /** Field that allows to keep entries in neighbor table during network discovery request called from application */
  bool clearNeighborTable;
} NWK_NetworkDiscoveryReq_t;

/******************************************************************************
                              Prototypes section
 ******************************************************************************/
/**************************************************************************//**
  \brief NLME-NETWORK-DISCOVERY request primitive's prototype.

  \param[in] req - NLME-NETWORK-DISCOVERY request parameters' structure pointer.
  \return None.
 ******************************************************************************/
void NWK_NetworkDiscoveryReq(NWK_NetworkDiscoveryReq_t *const req);

#endif /* _NLME_NETWORK_DISCOVERY_H */
/** eof nlmeNetworkDiscovery.h */