summaryrefslogtreecommitdiffhomepage
path: root/digital/zigbit/bitcloud/stack/Components/NWK/include/nlmeEdScan.h
blob: 0e5a09bc535365841304e5c6cd5642a841e96e8b (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
/**************************************************************************//**
  \file nlmeEdScan.h

  \brief NLME-ED-SCAN 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: nlmeEdScan.h 17448 2011-06-09 13:53:59Z ataradov $
 ******************************************************************************/
#if !defined _NLME_ED_SCAN_H
#define _NLME_ED_SCAN_H

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

/******************************************************************************
                               Define(s) section
 ******************************************************************************/
/** Maximum number of channels which can be scanned for one request. */
#define MAX_EDSCAN_CHANNEL_AMOUNT 16U

/******************************************************************************
                                 Types section
 ******************************************************************************/
/**//**
 * \brief NLME-ED-SCAN confirm primitive's parameters structure declaration.
 * ZigBee Specification r17, 3.2.2.10 NLME-ED-SCAN.confirm
 */
typedef struct _NWK_EDScanConf_t
{
  /** The status of the request. */
  NWK_Status_t status;
  /** Indicates which channels given in the request were not scanned. */
  ChannelsMask_t unScannedChannels;
  /** Size of energyDetectList */
  uint8_t energyDetectListSize;
  /** The list of energy measurements */
  PHY_EnergyLevel_t energyDetectList[MAX_EDSCAN_CHANNEL_AMOUNT];
} NWK_EDScanConf_t;

/**//**
 * \brief NLME-ED-SCAN request primitive's parameters structure declaration.
 * Zigbee Specification r17, 3.2.2.9 NLME-ED-SCAN.request.
 */
typedef struct _NWK_EDScanReq_t
{
  /** Service fields - for internal needs. */
  struct
  {
    QueueElement_t qelem; /**< link used for queuing */
    MAC_ScanReq_t macScanReq;
  } service;
  /** Bitmask of channels are to be scanned */
  ChannelsMask_t scanChannels;
  /** A value used to calculate the length of time to spend
   * scanning each channel. */
  ScanDuration_t scanDuration;
  /** NLME-ED-SCAN confirm callback function's pointer. */
  void (*NWK_EDScanConf)(NWK_EDScanConf_t *conf);
  NWK_EDScanConf_t confirm;
} NWK_EDScanReq_t;

/******************************************************************************
                               Prototypes section
 ******************************************************************************/
/**************************************************************************//**
  \brief NLME-ED-SCAN request primitive's prototype.

  \param[in] req - NLME-ED-SCAN request parameters' structure pointer.
  \return None.
 ******************************************************************************/
void NWK_EDScanReq(NWK_EDScanReq_t *const req);

#endif /* _NLME_ED_SCAN_H */
/** eof nlmeEdScan.h */