summaryrefslogtreecommitdiffhomepage
path: root/digital/zigbit/bitcloud/stack/Components/ZDO/include/private/zdoLeaveNetwork.h
blob: 1b16792c4e285ad3665af1ff80a381f12009feea (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
/**************************************************************************//**
  \file zdoLeaveNetwork.h

  \brief Interface for ZDO Leave Network routines

  \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:
    29.10.09 A. Taradov - Created
******************************************************************************/
#ifndef _ZDOLEAVENETWORK_H
#define _ZDOLEAVENETWORK_H

/******************************************************************************
                        Includes section
******************************************************************************/
#include <zdo.h>

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

/******************************************************************************
                        Types section
******************************************************************************/
typedef enum _ZdoLeaveNetworkState_t
{
  ZDO_LEAVE_NETWORK_IDLE_STATE,
  ZDO_LEAVE_NETWORK_NWK_LEAVE_STATE,
  ZDO_LEAVE_NETWORK_APS_STOP_STATE
} ZdoLeaveNetworkState_t;

typedef void (ZdoLeaveNetworkConf_t)(ZDO_Status_t status);

typedef struct _ZdoLeaveNetwork_t
{
  ZdoLeaveNetworkState_t state;
  ZdoLeaveNetworkConf_t  *confirm;
  bool                   rejoin;
} ZdoLeaveNetwork_t;

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

/******************************************************************************
  Network leave indication
  Parameters:
    rejoin - true if rejoin is required
  Return:
    none
******************************************************************************/
void zdoLeaveNetworkInd(bool rejoin);

/******************************************************************************
  Leave device from network
  Parameters:
    removeChildren - remove or not children
    rejoin - perform or not rejoin after leaving
  Returns:
    None
******************************************************************************/
void zdoLeaveNetworkReq(bool removeChildren, bool rejoin);

/******************************************************************************
  Leave device from network. Leave Network module must be allocated before
    calling this function.
  Parameters:
    removeChildren - remove or not children
    rejoin - perform or not rejoin after leaving
  Returns:
    None
******************************************************************************/
void zdoLeaveNetwork(bool removeChildren, bool rejoin);

/******************************************************************************
  Allocate Leave Network module
  Parameters:
    leaveNetworkConf - confirmation callback
  Return:
    true - if module was alocated, false otherwise
******************************************************************************/
bool zdoLeaveNetworkAlloc(ZdoLeaveNetworkConf_t *leaveNetworkConf);

/******************************************************************************
  Free Leave Network module
  Parameters:
    none
  Return:
    none
******************************************************************************/
void zdoLeaveNetworkFree(void);

/******************************************************************************
  Reset Leave Network component.
  Parameters:
    none
  Return:
    none
******************************************************************************/
void zdoLeaveNetworkReset(void);

#endif // _ZDOLEAVENETWORK_H

// eof zdoLeaveNetwork.h