summaryrefslogtreecommitdiff
path: root/digital/zigbit/bitcloud/stack/Components/APS/include/intrpData.h
blob: 4f46d490899ba86d1cc9f526b49f952c7a01071c (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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
/**************************************************************************//**
  \file  intrpData.h

  \brief Interface of inter-PAN transmission.

  \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:
    2010-02-18 A. Kostyukov - Created.
    2010-11-20 Max Gekk - Refactoring.
   Last change:
    $Id: intrpData.h 18271 2011-08-18 12:07:56Z nfomin $
 ******************************************************************************/
#if !defined _INTRP_DATA_H
#define _INTRP_DATA_H
/**//**
 *
 *  Inter-PAN is a transmission mechanism whereby ZigBee devices can perform
 * limited, insecure, and possibly anonymous exchanges of information with
 * devices in their local neighborhood without having to form or join the same
 * ZigBee network. See ZigBee SE Profile Spec r15, page 81.
 *
 **/

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

#if defined _INTERPAN_

/******************************************************************************
                    Definitions section
******************************************************************************/
#define INTRP_NO_PANID_COMPRESSION_TXOPTION 1u

/******************************************************************************
                                Types section
 ******************************************************************************/
/** Type of handle associated with the inter-PAN ASDU to be transmitted. */
typedef uint8_t IntrpAsduHandle_t;
/** Type of inter-PAN frame length. */
typedef uint8_t IntrpLength_t;

/**//**
 * \struct INTRP_DataConf_t intrpData.h "aps.h"
 *
 * \brief INTRP-DATA confirm primitive's parameters structure declaration.
 *
 *  ZigBee Smart Energy profile specification r15, B.3.2.
 * The INTRP-DATA.confirm Primitive, page 85.
 **/
typedef struct
{
  /** An integer handle associated with the transmitted frame. */
  IntrpAsduHandle_t  asduHandle;
  /** The status of the ASDU transmission corresponding to ASDUHandle as
   * returned by the MAC.*/
  MAC_Status_t  status;
} INTRP_DataConf_t;

typedef uint8_t INTRP_TxOptions_t;

/**//**
 * \struct INTRP_DataReq_t intrpData.h "aps.h"
 *
 * \brief INTRP-DATA.request primitive's parameters structure declaration.
 *
 *  ZigBee Smart Energy profile specification r15, B.3.1
 * The INTRP-DATA.request Primitive, page 83.
 **/
typedef struct
{
  /** \cond SERVICE_FIELDS **/
  struct
  {
    /** MCPS-DATA request primitive's parameters structure. */
    MAC_DataReq_t  macDataReq;
  } service;
  /** \endcond **/

  /** The addressing mode for the destination address used in this primitive.
   *  This parameter can take one of the values from the following list:
   *    \li 0x01 = 16-bit group address
   *    \li 0x02 = 16-bit NWK address, normally  the broadcast address 0xffff
   *    \li 0x03 = 64-bit extended address
   **/
  APS_AddrMode_t dstAddrMode;
  /** \ref Endian "[LE]" The 16-bit PAN identifier of the entity or entities
   * to which the ASDU is being  transferred or the broadcast PANId 0xffff. */
  PanId_t dstPANID;
  /** \ref Endian "[LE]" The address of the entity or entities to which
   *  the ASDU is being transferred. */
  MAC_Addr_t dstAddress;
  /** \ref Endian "[LE]" The identifier of the profile for which this frame is
   * intended. */
  ProfileId_t profileId;
  /** \ref Endian "[LE]" The identifier of the cluster, within the profile
   * specified by the ProfileId parameter, which defines the application
   * semantics of the ASDU. **/
  ClusterId_t clusterId;
  /** The number of octets in the ASDU to be transmitted. */
  IntrpLength_t asduLength;
  /** The set of octets comprising the ASDU to be transferred. */
  uint8_t *asdu;
  /** An integer handle associated with the ASDU to be transmitted. */
  IntrpAsduHandle_t asduHandle;
  /** Callback function pointer as a handler of corresponding
   *  confirm primitive.
   **/
  void (*INTRP_DataConf)(INTRP_DataConf_t *conf);
  /** Confirm primitive as a parameter of the callback function. */
  INTRP_DataConf_t confirm;
  /** Transmission options for this request **/
  INTRP_TxOptions_t txOptions;
} INTRP_DataReq_t;

/**//**
 * \struct INTRP_DataInd_t intrpData.h "aps.h"
 *
 * \brief INTRP-DATA indication primitive's parameters structure declaration.
 *
 *  ZigBee Smart Energy profile specification r15, B.3.3.
 * The INTRP-DATA.indication Primitive, page 86.
 **/
typedef struct
{
  /** \ref Endian "[LE]" The 16-bit PAN identifier of the entity from which
   *  the ASDU is being transferred. */
  PanId_t srcPANID;
  /** \ref Endian "[LE]" The device address of the entity from which
   *  the ASDU is being transferred. */
  MAC_Addr_t srcAddress;
  /** The addressing mode for the destination address used in this primitive.
   *  This parameter can take one of the values from the following list:
   *   \li 0x01 = 16-bit group address
   *   \li 0x02 = 16-bit NWK address, normally  the broadcast address 0xffff
   *   \li 0x03 = 64-bit extended address.
   **/
  APS_AddrMode_t dstAddrMode;
  /** \ref Endian "[LE]" The 16-bit PAN identifier of the entity or entities
   * to which the ASDU is being  transferred or the broadcast PANId 0xffff. */
  PanId_t dstPANID;
  /** \ref Endian "[LE]" The address of the entity or entities to which
   *  the ASDU is being transferred. */
  MAC_Addr_t dstAddress;
  /** \ref Endian "[LE]"
   * The identifier of the profile for which this frame is intended. */
  ProfileId_t profileId;
  /** \ref Endian "[LE]" The identifier of the cluster, within the profile
   * specified by the ProfileId parameter, which defines the application
   * semantics of the ASDU. */
  ClusterId_t clusterId;
  /** The number of octets in the ASDU to be transmitted. */
  IntrpLength_t asduLength;
  /** The set of octets comprising the ASDU to be transferred. */
  uint8_t *asdu;
  /** The link quality observed during the reception of the ASDU. */
  Lqi_t lqi;
  /** RSSI observed during the reception of the ASDU. */
  Lqi_t rssi;
} INTRP_DataInd_t;

/******************************************************************************
                              Prototypes section
 ******************************************************************************/
/**************************************************************************//**
  \brief INTRP-DATA request primitive's prototype.

  \param[in] req - INTRP-DATA request parameters' structure pointer.

  \return None.
 ******************************************************************************/
void INTRP_DataReq(INTRP_DataReq_t *const req);

/**************************************************************************//**
  \brief INTRP-DATA indication primitive's prototype.

  \param[in] ind - INTRP-DATA indication parameters' structure pointer.

  \return None.
 ******************************************************************************/
void INTRP_DataInd(INTRP_DataInd_t *ind);

#endif /* _INTERPAN_ */
#endif /* _INTRP_DATA_H */
/** eof intrpData.h */