summaryrefslogtreecommitdiff
path: root/digital/zigbit/bitcloud/stack/Components/MAC_PHY/include/macDisassociate.h
blob: 81e22edf80b0b50740da5c72be655e07cbf4d09c (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
123
124
125
126
127
128
129
/**************************************************************************//**
  \file macDisassociate.h
  
  \brief Types', constants' and functions' declarations for IEEE 802.15.4-2006 
    disassociation primitives.
    
  \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:     
      18/06/07 ALuzhetsky - Created.
******************************************************************************/

#ifndef _MACDISASSOCIATE_H
#define _MACDISASSOCIATE_H

/******************************************************************************
                        Includes section
******************************************************************************/
#include <macAddr.h>
#include <macCommon.h>

/******************************************************************************
                        Defines section
******************************************************************************/


/******************************************************************************
                        Types section
******************************************************************************/
/**************************************************************************//**
  \brief Disassociation possible reasons.

  IEEE 802.15.4-2006 7.3.3.2 Disassociation Reason field.
******************************************************************************/
typedef enum
{
  MAC_COORDINATOR_WISHES_DEVICE_LEAVE_PAN_REASON = 0x01,
  MAC_DEVICE_WISHES_LEAVE_PAN_REASON             = 0x02,
} MAC_DeassociateReason_t;

/**************************************************************************//**
  \brief MLME-DISASSOCIATE confirm primitive's parameters structure declaration.

  IEEE 802.15.4-2006 7.1.4.3 MLME-DISASSOCIATE.confirm.
******************************************************************************/
typedef struct
{
  //! The status of the disassociation attempt.
  MAC_Status_t   status;
  //! The addressing mode of the device that has either requested
  //! disassociation or been instructed to disassociate by its coordinator.
  MAC_AddrMode_t deviceAddrMode;
  //! The PAN identifier of the device that has either requested disassociation or
  //! been instructed to disassociate by its coordinator.
  PanId_t        devicePanId;
  //! The address of the device that has either requested disassociation or
  //! been instructed to disassociate by its coordinator.
  MAC_Addr_t     deviceAddr;
}  MAC_DisassociateConf_t;

/**************************************************************************//**
  \brief MLME-DISASSOCIATE request primitive's parameters structure declaration.

  IEEE 802.15.4-2006 7.1.4.3 MLME-DISASSOCIATE.confirm.
******************************************************************************/
typedef struct
{
  //! Service field - for internal needs.
  MAC_ServiceTransaction_t  service;
  //! The addressing mode of the device to which to send the disassociation 
  //! notification command.
  MAC_AddrMode_t            deviceAddrMode;
  //! The PAN identifier of the device to which to send the disassociation 
  //! notification command.
  PanId_t                   devicePanId;
  //! The address of the device to which to send the disassociation notification command.
  MAC_Addr_t                deviceAddr;
  //! The reason for the disassociation.
  MAC_DeassociateReason_t   reason;
  //! TRUE if the disassociation notification command is to be sent indirectly.
  bool                      txIndirect;
  //! MLME-DISASSOCIATE confirm callback fubction's pointer.
  void (*MAC_DisassociateConf)(MAC_DisassociateConf_t *conf);
  //! MLME-DISASSOCIATE confirm parameters' structure.
  MAC_DisassociateConf_t confirm;
}  MAC_DisassociateReq_t;

/*************************************************************************//**
  \brief MLME-DISASSOCIATE indication primitive's parameters.

  IEEE 802.15.4-2006 7.1.4.2 MLME-DISASSOCIATE.indication.
*****************************************************************************/
typedef struct
{
  //! The address of the device requesting disassociation.
  ExtAddr_t                 extAddr;
  //! The reason for the disassociation.
  MAC_DeassociateReason_t   reason;
}  MAC_DisassociateInd_t;


/******************************************************************************
                        Prototypes section
******************************************************************************/
/**************************************************************************//**
  \brief MLME-DISASSOCIATE request primitive's prototype.
  
  \param reqParams - MLME-DISASSOCIATE request parameters' structure pointer.
  \return none.
******************************************************************************/
void MAC_DisassociateReq(MAC_DisassociateReq_t *reqParams);

/**************************************************************************//**
  \brief MLME-DISASSOCIATE indication primitive's prototype.
  
  \param indParams - MLME-DISASSOCIATE indication parameters' structure pointer.
  \return none.
******************************************************************************/
extern void MAC_DisassociateInd(MAC_DisassociateInd_t *indParams);

#endif /* _MACDISASSOCIATE_H */

// eof macDisassociate.h