summaryrefslogtreecommitdiffhomepage
path: root/digital/zigbit/bitcloud/stack/Components/ZCL/include/zclZllNetwork.h
blob: adece9aaa112137fc67c7ae718825aed86833c37 (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
/**************************************************************************//**
  \file zclZllNetwork.h

  \brief
    ZLL network functionality 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:
    22.03.10 A. Taradov - Created.
******************************************************************************/
#ifndef _ZCLZLLNETWORK_H
#define	_ZCLZLLNETWORK_H

/******************************************************************************
                    Includes section
******************************************************************************/
#include <zclZll.h>
#include <zclZllIB.h>
#include <zclZllScan.h>
#include <intrpData.h>

/******************************************************************************
                    Definitions section
******************************************************************************/

/******************************************************************************
                    Types section
******************************************************************************/
typedef struct _ZCL_ZllStartNetworkConf_t
{
  ZCL_ZllStatus_t status;
} ZCL_ZllStartNetworkConf_t;

typedef struct _ZCL_ZllStartNetworkReq_t
{
  ZCL_ZllStartNetworkConf_t confirm;
  ZCL_ZllScanDeviceInfo_t   *otherDevice;
  void (*ZCL_ZllStartNetworkConf)(ZCL_ZllStartNetworkConf_t *conf);
} ZCL_ZllStartNetworkReq_t;

/*! Select ZLL device confirm parameters */
typedef struct _ZCL_SelectDeviceConf_t
{
  /* Operation status */
  ZCL_ZllStatus_t status;
} ZCL_SelectDeviceConf_t;

/*! Select ZLL device request parameters */
typedef struct _ZCL_ZllSelectDeviceReq_t
{
  /*! Selected device information */
  ZCL_ZllScanDeviceInfo_t *deviceInfo;
  /*! MAC-SET.request primitive */
  MAC_SetReq_t macSetReq;
  /*! Confirm callback pointer */
  void (*ZCL_ZllSelectDeviceConf)(ZCL_SelectDeviceConf_t *conf);
  /*! Select ZLL device confirm info */
  ZCL_SelectDeviceConf_t confirm;
} ZCL_ZllSelectDeviceReq_t;

/******************************************************************************
                    Prototypes section
******************************************************************************/

/**************************************************************************//**
\brief Reset ZLL network module.
******************************************************************************/
void ZCL_ZllNetworkReset(void);

/**************************************************************************//**
\brief Send ZLL start network request. Should be called only by end devices.

The function sends an Inter-PAN command containing network parameters to 
the selected router. The router is notified about receiving network parameters
via ZCL_ZllStartInd() (this function should be implemented on the router). 
Upon receiving such indication the router is expected to rejoin the nework,
using ZDO functions. The end device that has issued the request should also
rejoin the network to join the router.

The device to which the ZLL start network request will be sent is set
with the ZCL_ZllSelectDeviceReq() function.

\param req - request parameters
******************************************************************************/
void ZCL_ZllStartNetworkReq(ZCL_ZllStartNetworkReq_t *req);

/**************************************************************************//**
\brief INTRP-DATA.indication primitive
\param[in] ind - indication parameters
******************************************************************************/
void ZCL_ZllNetworkDataInd(INTRP_DataInd_t *ind);

/**************************************************************************//**
\brief Select a device discovered during scanning

Using this function, the application specifies a device to which it will
send an identify request and a start network request. Information about the
device that should be provided for this function is received during network 
scan (performed by ZCL_ZllScanReq()).

\param[in] req - request parameters
******************************************************************************/
void ZCL_ZllSelectDeviceReq(ZCL_ZllSelectDeviceReq_t *req);

#endif // _ZCLZLLNETWORK_H

// eof zclZllNetwork.h