zcl.h 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931
  1. /**************************************************************************************************
  2. Filename: zcl.h
  3. Revised: $Date: 2011-12-19 12:28:26 -0800 (Mon, 19 Dec 2011) $
  4. Revision: $Revision: 28712 $
  5. Description: This file contains the Zigbee Cluster Library Foundation definitions.
  6. Copyright 2006-2011 Texas Instruments Incorporated. All rights reserved.
  7. IMPORTANT: Your use of this Software is limited to those specific rights
  8. granted under the terms of a software license agreement between the user
  9. who downloaded the software, his/her employer (which must be your employer)
  10. and Texas Instruments Incorporated (the "License"). You may not use this
  11. Software unless you agree to abide by the terms of the License. The License
  12. limits your use, and you acknowledge, that the Software may not be modified,
  13. copied or distributed unless embedded on a Texas Instruments microcontroller
  14. or used solely and exclusively in conjunction with a Texas Instruments radio
  15. frequency transceiver, which is integrated into your product. Other than for
  16. the foregoing purpose, you may not use, reproduce, copy, prepare derivative
  17. works of, modify, distribute, perform, display or sell this Software and/or
  18. its documentation for any purpose.
  19. YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
  20. PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
  21. INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
  22. NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
  23. TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
  24. NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
  25. LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
  26. INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
  27. OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
  28. OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
  29. (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
  30. Should you have any questions regarding your right to use this Software,
  31. contact Texas Instruments Incorporated at www.TI.com.
  32. **************************************************************************************************/
  33. #ifndef ZCL_H
  34. #define ZCL_H
  35. #ifdef __cplusplus
  36. extern "C"
  37. {
  38. #endif
  39. /*********************************************************************
  40. * INCLUDES
  41. */
  42. #include "AF.h"
  43. #include "aps_groups.h"
  44. /*********************************************************************
  45. * CONSTANTS
  46. */
  47. // General Clusters
  48. #define ZCL_CLUSTER_ID_GEN_BASIC 0x0000
  49. #define ZCL_CLUSTER_ID_GEN_POWER_CFG 0x0001
  50. #define ZCL_CLUSTER_ID_GEN_DEVICE_TEMP_CONFIG 0x0002
  51. #define ZCL_CLUSTER_ID_GEN_IDENTIFY 0x0003
  52. #define ZCL_CLUSTER_ID_GEN_GROUPS 0x0004
  53. #define ZCL_CLUSTER_ID_GEN_SCENES 0x0005
  54. #define ZCL_CLUSTER_ID_GEN_ON_OFF 0x0006
  55. #define ZCL_CLUSTER_ID_GEN_ON_OFF_SWITCH_CONFIG 0x0007
  56. #define ZCL_CLUSTER_ID_GEN_LEVEL_CONTROL 0x0008
  57. #define ZCL_CLUSTER_ID_GEN_ALARMS 0x0009
  58. #define ZCL_CLUSTER_ID_GEN_TIME 0x000A
  59. #define ZCL_CLUSTER_ID_GEN_LOCATION 0x000B
  60. #define ZCL_CLUSTER_ID_GEN_ANALOG_INPUT_BASIC 0x000C
  61. #define ZCL_CLUSTER_ID_GEN_ANALOG_OUTPUT_BASIC 0x000D
  62. #define ZCL_CLUSTER_ID_GEN_ANALOG_VALUE_BASIC 0x000E
  63. #define ZCL_CLUSTER_ID_GEN_BINARY_INPUT_BASIC 0x000F
  64. #define ZCL_CLUSTER_ID_GEN_BINARY_OUTPUT_BASIC 0x0010
  65. #define ZCL_CLUSTER_ID_GEN_BINARY_VALUE_BASIC 0x0011
  66. #define ZCL_CLUSTER_ID_GEN_MULTISTATE_INPUT_BASIC 0x0012
  67. #define ZCL_CLUSTER_ID_GEN_MULTISTATE_OUTPUT_BASIC 0x0013
  68. #define ZCL_CLUSTER_ID_GEN_MULTISTATE_VALUE_BASIC 0x0014
  69. #define ZCL_CLUSTER_ID_GEN_COMMISSIONING 0x0015
  70. #define ZCL_CLUSTER_ID_OTA 0x0019
  71. #define ZCL_CLUSTER_ID_GREEN_POWER_PROXY 0x001A
  72. // Closures Clusters
  73. #define ZCL_CLUSTER_ID_CLOSURES_SHADE_CONFIG 0x0100
  74. #define ZCL_CLUSTER_ID_CLOSURES_DOOR_LOCK 0x0101
  75. #define ZCL_CLUSTER_ID_CLOSURES_WINDOW_COVERING 0x0102
  76. // HVAC Clusters
  77. #define ZCL_CLUSTER_ID_HVAC_PUMP_CONFIG_CONTROL 0x0200
  78. #define ZCL_CLUSTER_ID_HAVC_THERMOSTAT 0x0201
  79. #define ZCL_CLUSTER_ID_HAVC_FAN_CONTROL 0x0202
  80. #define ZCL_CLUSTER_ID_HAVC_DIHUMIDIFICATION_CONTROL 0x0203
  81. #define ZCL_CLUSTER_ID_HAVC_USER_INTERFACE_CONFIG 0x0204
  82. // Lighting Clusters
  83. #define ZCL_CLUSTER_ID_LIGHTING_COLOR_CONTROL 0x0300
  84. #define ZCL_CLUSTER_ID_LIGHTING_BALLAST_CONFIG 0x0301
  85. // Measurement and Sensing Clusters
  86. #define ZCL_CLUSTER_ID_MS_ILLUMINANCE_MEASUREMENT 0x0400
  87. #define ZCL_CLUSTER_ID_MS_ILLUMINANCE_LEVEL_SENSING_CONFIG 0x0401
  88. #define ZCL_CLUSTER_ID_MS_TEMPERATURE_MEASUREMENT 0x0402
  89. #define ZCL_CLUSTER_ID_MS_PRESSURE_MEASUREMENT 0x0403
  90. #define ZCL_CLUSTER_ID_MS_FLOW_MEASUREMENT 0x0404
  91. #define ZCL_CLUSTER_ID_MS_RELATIVE_HUMIDITY 0x0405
  92. #define ZCL_CLUSTER_ID_MS_OCCUPANCY_SENSING 0x0406
  93. // Security and Safety (SS) Clusters
  94. #define ZCL_CLUSTER_ID_SS_IAS_ZONE 0x0500
  95. #define ZCL_CLUSTER_ID_SS_IAS_ACE 0x0501
  96. #define ZCL_CLUSTER_ID_SS_IAS_WD 0x0502
  97. // Protocol Interfaces
  98. #define ZCL_CLUSTER_ID_PI_GENERIC_TUNNEL 0x0600
  99. #define ZCL_CLUSTER_ID_PI_BACNET_PROTOCOL_TUNNEL 0x0601
  100. #define ZCL_CLUSTER_ID_PI_ANALOG_INPUT_BACNET_REG 0x0602
  101. #define ZCL_CLUSTER_ID_PI_ANALOG_INPUT_BACNET_EXT 0x0603
  102. #define ZCL_CLUSTER_ID_PI_ANALOG_OUTPUT_BACNET_REG 0x0604
  103. #define ZCL_CLUSTER_ID_PI_ANALOG_OUTPUT_BACNET_EXT 0x0605
  104. #define ZCL_CLUSTER_ID_PI_ANALOG_VALUE_BACNET_REG 0x0606
  105. #define ZCL_CLUSTER_ID_PI_ANALOG_VALUE_BACNET_EXT 0x0607
  106. #define ZCL_CLUSTER_ID_PI_BINARY_INPUT_BACNET_REG 0x0608
  107. #define ZCL_CLUSTER_ID_PI_BINARY_INPUT_BACNET_EXT 0x0609
  108. #define ZCL_CLUSTER_ID_PI_BINARY_OUTPUT_BACNET_REG 0x060A
  109. #define ZCL_CLUSTER_ID_PI_BINARY_OUTPUT_BACNET_EXT 0x060B
  110. #define ZCL_CLUSTER_ID_PI_BINARY_VALUE_BACNET_REG 0x060C
  111. #define ZCL_CLUSTER_ID_PI_BINARY_VALUE_BACNET_EXT 0x060D
  112. #define ZCL_CLUSTER_ID_PI_MULTISTATE_INPUT_BACNET_REG 0x060E
  113. #define ZCL_CLUSTER_ID_PI_MULTISTATE_INPUT_BACNET_EXT 0x060F
  114. #define ZCL_CLUSTER_ID_PI_MULTISTATE_OUTPUT_BACNET_REG 0x0610
  115. #define ZCL_CLUSTER_ID_PI_MULTISTATE_OUTPUT_BACNET_EXT 0x0611
  116. #define ZCL_CLUSTER_ID_PI_MULTISTATE_VALUE_BACNET_REG 0x0612
  117. #define ZCL_CLUSTER_ID_PI_MULTISTATE_VALUE_BACNET_EXT 0x0613
  118. #define ZCL_CLUSTER_ID_PI_11073_PROTOCOL_TUNNEL 0x0614
  119. // Advanced Metering Initiative (SE) Clusters
  120. #define ZCL_CLUSTER_ID_SE_PRICING 0x0700
  121. #define ZCL_CLUSTER_ID_SE_LOAD_CONTROL 0x0701
  122. #define ZCL_CLUSTER_ID_SE_SIMPLE_METERING 0x0702
  123. #define ZCL_CLUSTER_ID_SE_MESSAGE 0x0703
  124. #define ZCL_CLUSTER_ID_SE_SE_TUNNELING 0x0704
  125. #define ZCL_CLUSTER_ID_SE_PREPAYMENT 0x0705
  126. #ifdef SE_UK_EXT
  127. #define ZCL_CLUSTER_ID_SE_TOU_CALENDAR 0x0706
  128. #define ZCL_CLUSTER_ID_SE_DEVICE_MGMT 0x0707
  129. #endif // SE_UK_EXT
  130. #define ZCL_CLUSTER_ID_GEN_KEY_ESTABLISHMENT 0x0800
  131. // Smart Light cluster
  132. #define ZCL_CLUSTER_ID_SMART_LIGHT 0x1000
  133. /*** Frame Control bit mask ***/
  134. #define ZCL_FRAME_CONTROL_TYPE 0x03
  135. #define ZCL_FRAME_CONTROL_MANU_SPECIFIC 0x04
  136. #define ZCL_FRAME_CONTROL_DIRECTION 0x08
  137. #define ZCL_FRAME_CONTROL_DISABLE_DEFAULT_RSP 0x10
  138. /*** Frame Types ***/
  139. #define ZCL_FRAME_TYPE_PROFILE_CMD 0x00
  140. #define ZCL_FRAME_TYPE_SPECIFIC_CMD 0x01
  141. /*** Frame Client/Server Directions ***/
  142. #define ZCL_FRAME_CLIENT_SERVER_DIR 0x00
  143. #define ZCL_FRAME_SERVER_CLIENT_DIR 0x01
  144. /*** Chipcon Manufacturer Code ***/
  145. #define CC_MANUFACTURER_CODE 0x1001
  146. /*** Foundation Command IDs ***/
  147. #define ZCL_CMD_READ 0x00
  148. #define ZCL_CMD_READ_RSP 0x01
  149. #define ZCL_CMD_WRITE 0x02
  150. #define ZCL_CMD_WRITE_UNDIVIDED 0x03
  151. #define ZCL_CMD_WRITE_RSP 0x04
  152. #define ZCL_CMD_WRITE_NO_RSP 0x05
  153. #define ZCL_CMD_CONFIG_REPORT 0x06
  154. #define ZCL_CMD_CONFIG_REPORT_RSP 0x07
  155. #define ZCL_CMD_READ_REPORT_CFG 0x08
  156. #define ZCL_CMD_READ_REPORT_CFG_RSP 0x09
  157. #define ZCL_CMD_REPORT 0x0a
  158. #define ZCL_CMD_DEFAULT_RSP 0x0b
  159. #define ZCL_CMD_DISCOVER 0x0c
  160. #define ZCL_CMD_DISCOVER_RSP 0x0d
  161. #define ZCL_CMD_MAX ZCL_CMD_DISCOVER_RSP
  162. /*** Data Types ***/
  163. #define ZCL_DATATYPE_NO_DATA 0x00
  164. #define ZCL_DATATYPE_DATA8 0x08
  165. #define ZCL_DATATYPE_DATA16 0x09
  166. #define ZCL_DATATYPE_DATA24 0x0a
  167. #define ZCL_DATATYPE_DATA32 0x0b
  168. #define ZCL_DATATYPE_DATA40 0x0c
  169. #define ZCL_DATATYPE_DATA48 0x0d
  170. #define ZCL_DATATYPE_DATA56 0x0e
  171. #define ZCL_DATATYPE_DATA64 0x0f
  172. #define ZCL_DATATYPE_BOOLEAN 0x10
  173. #define ZCL_DATATYPE_BITMAP8 0x18
  174. #define ZCL_DATATYPE_BITMAP16 0x19
  175. #define ZCL_DATATYPE_BITMAP24 0x1a
  176. #define ZCL_DATATYPE_BITMAP32 0x1b
  177. #define ZCL_DATATYPE_BITMAP40 0x1c
  178. #define ZCL_DATATYPE_BITMAP48 0x1d
  179. #define ZCL_DATATYPE_BITMAP56 0x1e
  180. #define ZCL_DATATYPE_BITMAP64 0x1f
  181. #define ZCL_DATATYPE_UINT8 0x20
  182. #define ZCL_DATATYPE_UINT16 0x21
  183. #define ZCL_DATATYPE_UINT24 0x22
  184. #define ZCL_DATATYPE_UINT32 0x23
  185. #define ZCL_DATATYPE_UINT40 0x24
  186. #define ZCL_DATATYPE_UINT48 0x25
  187. #define ZCL_DATATYPE_UINT56 0x26
  188. #define ZCL_DATATYPE_UINT64 0x27
  189. #define ZCL_DATATYPE_INT8 0x28
  190. #define ZCL_DATATYPE_INT16 0x29
  191. #define ZCL_DATATYPE_INT24 0x2a
  192. #define ZCL_DATATYPE_INT32 0x2b
  193. #define ZCL_DATATYPE_INT40 0x2c
  194. #define ZCL_DATATYPE_INT48 0x2d
  195. #define ZCL_DATATYPE_INT56 0x2e
  196. #define ZCL_DATATYPE_INT64 0x2f
  197. #define ZCL_DATATYPE_ENUM8 0x30
  198. #define ZCL_DATATYPE_ENUM16 0x31
  199. #define ZCL_DATATYPE_SEMI_PREC 0x38
  200. #define ZCL_DATATYPE_SINGLE_PREC 0x39
  201. #define ZCL_DATATYPE_DOUBLE_PREC 0x3a
  202. #define ZCL_DATATYPE_OCTET_STR 0x41
  203. #define ZCL_DATATYPE_CHAR_STR 0x42
  204. #define ZCL_DATATYPE_LONG_OCTET_STR 0x43
  205. #define ZCL_DATATYPE_LONG_CHAR_STR 0x44
  206. #define ZCL_DATATYPE_ARRAY 0x48
  207. #define ZCL_DATATYPE_STRUCT 0x4c
  208. #define ZCL_DATATYPE_SET 0x50
  209. #define ZCL_DATATYPE_BAG 0x51
  210. #define ZCL_DATATYPE_TOD 0xe0
  211. #define ZCL_DATATYPE_DATE 0xe1
  212. #define ZCL_DATATYPE_UTC 0xe2
  213. #define ZCL_DATATYPE_CLUSTER_ID 0xe8
  214. #define ZCL_DATATYPE_ATTR_ID 0xe9
  215. #define ZCL_DATATYPE_BAC_OID 0xea
  216. #define ZCL_DATATYPE_IEEE_ADDR 0xf0
  217. #define ZCL_DATATYPE_128_BIT_SEC_KEY 0xf1
  218. #define ZCL_DATATYPE_UNKNOWN 0xff
  219. /*** Error Status Codes ***/
  220. #define ZCL_STATUS_SUCCESS 0x00
  221. #define ZCL_STATUS_FAILURE 0x01
  222. // 0x02-0x7D are reserved.
  223. #define ZCL_STATUS_NOT_AUTHORIZED 0x7E
  224. #define ZCL_STATUS_MALFORMED_COMMAND 0x80
  225. #define ZCL_STATUS_UNSUP_CLUSTER_COMMAND 0x81
  226. #define ZCL_STATUS_UNSUP_GENERAL_COMMAND 0x82
  227. #define ZCL_STATUS_UNSUP_MANU_CLUSTER_COMMAND 0x83
  228. #define ZCL_STATUS_UNSUP_MANU_GENERAL_COMMAND 0x84
  229. #define ZCL_STATUS_INVALID_FIELD 0x85
  230. #define ZCL_STATUS_UNSUPPORTED_ATTRIBUTE 0x86
  231. #define ZCL_STATUS_INVALID_VALUE 0x87
  232. #define ZCL_STATUS_READ_ONLY 0x88
  233. #define ZCL_STATUS_INSUFFICIENT_SPACE 0x89
  234. #define ZCL_STATUS_DUPLICATE_EXISTS 0x8a
  235. #define ZCL_STATUS_NOT_FOUND 0x8b
  236. #define ZCL_STATUS_UNREPORTABLE_ATTRIBUTE 0x8c
  237. #define ZCL_STATUS_INVALID_DATA_TYPE 0x8d
  238. #define ZCL_STATUS_INVALID_SELECTOR 0x8e
  239. #define ZCL_STATUS_WRITE_ONLY 0x8f
  240. #define ZCL_STATUS_INCONSISTENT_STARTUP_STATE 0x90
  241. #define ZCL_STATUS_DEFINED_OUT_OF_BAND 0x91
  242. #define ZCL_STATUS_INCONSISTENT 0x92
  243. #define ZCL_STATUS_ACTION_DENIED 0x93
  244. #define ZCL_STATUS_TIMEOUT 0x94
  245. #define ZCL_STATUS_ABORT 0x95
  246. #define ZCL_STATUS_INVALID_IMAGE 0x96
  247. #define ZCL_STATUS_WAIT_FOR_DATA 0x97
  248. #define ZCL_STATUS_NO_IMAGE_AVAILABLE 0x98
  249. #define ZCL_STATUS_REQUIRE_MORE_IMAGE 0x99
  250. // 0xbd-bf are reserved.
  251. #define ZCL_STATUS_HARDWARE_FAILURE 0xc0
  252. #define ZCL_STATUS_SOFTWARE_FAILURE 0xc1
  253. #define ZCL_STATUS_CALIBRATION_ERROR 0xc2
  254. // 0xc3-0xff are reserved.
  255. #define ZCL_STATUS_CMD_HAS_RSP 0xFF // Non-standard status (used for Default Rsp)
  256. /*** Attribute Access Control - bit masks ***/
  257. #define ACCESS_CONTROL_READ 0x01
  258. #define ACCESS_CONTROL_WRITE 0x02
  259. #define ACCESS_CONTROL_COMMAND 0x04
  260. #define ACCESS_CONTROL_AUTH_READ 0x10
  261. #define ACCESS_CONTROL_AUTH_WRITE 0x20
  262. #define ZCL_ATTR_ID_MAX 0xFFFF
  263. // Used by Configure Reporting Command
  264. #define ZCL_SEND_ATTR_REPORTS 0x00
  265. #define ZCL_EXPECT_ATTR_REPORTS 0x01
  266. // Predefined Maximum String Length
  267. #define MAX_UTF8_STRING_LEN 50
  268. // Used by zclReadWriteCB_t callback function
  269. #define ZCL_OPER_LEN 0x00 // Get length of attribute value to be read
  270. #define ZCL_OPER_READ 0x01 // Read attribute value
  271. #define ZCL_OPER_WRITE 0x02 // Write new attribute value
  272. /*********************************************************************
  273. * MACROS
  274. */
  275. #define zcl_ProfileCmd( a ) ( (a) == ZCL_FRAME_TYPE_PROFILE_CMD )
  276. #define zcl_ClusterCmd( a ) ( (a) == ZCL_FRAME_TYPE_SPECIFIC_CMD )
  277. #define zcl_ServerCmd( a ) ( (a) == ZCL_FRAME_CLIENT_SERVER_DIR )
  278. #define zcl_ClientCmd( a ) ( (a) == ZCL_FRAME_SERVER_CLIENT_DIR )
  279. #define UNICAST_MSG( msg ) ( (msg)->wasBroadcast == false && (msg)->groupId == 0 )
  280. // Padding needed if buffer has odd number of octects in length
  281. #define PADDING_NEEDED( bufLen ) ( (bufLen) % 2 )
  282. // Check for Cluster IDs
  283. #define ZCL_CLUSTER_ID_GEN( id ) ( /* (id) >= ZCL_CLUSTER_ID_GEN_BASIC &&*/ \
  284. (id) <= ZCL_CLUSTER_ID_GEN_COMMISSIONING )
  285. #define ZCL_CLUSTER_ID_CLOSURES( id ) ( (id) >= ZCL_CLUSTER_ID_CLOSURES_SHADE_CONFIG && \
  286. (id) <= ZCL_CLUSTER_ID_CLOSURES_WINDOW_COVERING )
  287. #define ZCL_CLUSTER_ID_HVAC( id ) ( (id) >= ZCL_CLUSTER_ID_HVAC_PUMP_CONFIG_CONTROL && \
  288. (id) <= ZCL_CLUSTER_ID_HAVC_USER_INTERFACE_CONFIG )
  289. #define ZCL_CLUSTER_ID_LIGHTING( id ) ( (id) >= ZCL_CLUSTER_ID_LIGHTING_COLOR_CONTROL && \
  290. (id) <= ZCL_CLUSTER_ID_LIGHTING_BALLAST_CONFIG )
  291. #define ZCL_CLUSTER_ID_MS( id ) ( (id) >= ZCL_CLUSTER_ID_MS_ILLUMINANCE_MEASUREMENT && \
  292. (id) <= ZCL_CLUSTER_ID_MS_OCCUPANCY_SENSING )
  293. #define ZCL_CLUSTER_ID_SS( id ) ( (id) >= ZCL_CLUSTER_ID_SS_IAS_ZONE && \
  294. (id) <= ZCL_CLUSTER_ID_SS_IAS_WD )
  295. #define ZCL_CLUSTER_ID_KEY( id ) ( (id) == ZCL_CLUSTER_ID_GEN_KEY_ESTABLISHMENT )
  296. #ifdef SE_UK_EXT
  297. #define ZCL_CLUSTER_ID_SE( id ) ( (id) >= ZCL_CLUSTER_ID_SE_PRICING && \
  298. (id) <= ZCL_CLUSTER_ID_SE_DEVICE_MGMT )
  299. #else
  300. #define ZCL_CLUSTER_ID_SE( id ) ( (id) >= ZCL_CLUSTER_ID_SE_PRICING && \
  301. (id) <= ZCL_CLUSTER_ID_SE_PREPAYMENT )
  302. #endif // SE_UK_EXT
  303. #define ZCL_CLUSTER_ID_PI( id ) ( (id) >= ZCL_CLUSTER_ID_PI_GENERIC_TUNNEL && \
  304. (id) <= ZCL_CLUSTER_ID_PI_11073_PROTOCOL_TUNNEL )
  305. #define ZCL_CLUSTER_ID_SL( id ) ( (id) == ZCL_CLUSTER_ID_SMART_LIGHT )
  306. /*********************************************************************
  307. * TYPEDEFS
  308. */
  309. // ZCL header - frame control field
  310. typedef struct
  311. {
  312. unsigned int type:2;
  313. unsigned int manuSpecific:1;
  314. unsigned int direction:1;
  315. unsigned int disableDefaultRsp:1;
  316. unsigned int reserved:3;
  317. } zclFrameControl_t;
  318. // ZCL header
  319. typedef struct
  320. {
  321. zclFrameControl_t fc;
  322. uint16 manuCode;
  323. uint8 transSeqNum;
  324. uint8 commandID;
  325. } zclFrameHdr_t;
  326. #ifdef ZCL_READ
  327. // Read Attribute Command format
  328. typedef struct
  329. {
  330. uint8 numAttr; // number of attributes in the list
  331. uint16 attrID[]; // supported attributes list - this structure should
  332. // be allocated with the appropriate number of attributes.
  333. } zclReadCmd_t;
  334. // Read Attribute Response Status record
  335. typedef struct
  336. {
  337. uint16 attrID; // attribute ID
  338. uint8 status; // should be ZCL_STATUS_SUCCESS or error
  339. uint8 dataType; // attribute data type
  340. uint8 *data; // this structure is allocated, so the data is HERE
  341. // - the size depends on the attribute data type
  342. } zclReadRspStatus_t;
  343. // Read Attribute Response Command format
  344. typedef struct
  345. {
  346. uint8 numAttr; // number of attributes in the list
  347. zclReadRspStatus_t attrList[]; // attribute status list
  348. } zclReadRspCmd_t;
  349. #endif // ZCL_READ
  350. // Write Attribute record
  351. typedef struct
  352. {
  353. uint16 attrID; // attribute ID
  354. uint8 dataType; // attribute data type
  355. uint8 *attrData; // this structure is allocated, so the data is HERE
  356. // - the size depends on the attribute data type
  357. } zclWriteRec_t;
  358. // Write Attribute Command format
  359. typedef struct
  360. {
  361. uint8 numAttr; // number of attribute records in the list
  362. zclWriteRec_t attrList[]; // attribute records
  363. } zclWriteCmd_t;
  364. // Write Attribute Status record
  365. typedef struct
  366. {
  367. uint8 status; // should be ZCL_STATUS_SUCCESS or error
  368. uint16 attrID; // attribute ID
  369. } zclWriteRspStatus_t;
  370. // Write Attribute Response Command format
  371. typedef struct
  372. {
  373. uint8 numAttr; // number of attribute status in the list
  374. zclWriteRspStatus_t attrList[]; // attribute status records
  375. } zclWriteRspCmd_t;
  376. // Configure Reporting Command format
  377. typedef struct
  378. {
  379. uint8 direction; // to send or receive reports of the attribute
  380. uint16 attrID; // attribute ID
  381. uint8 dataType; // attribute data type
  382. uint16 minReportInt; // minimum reporting interval
  383. uint16 maxReportInt; // maximum reporting interval
  384. uint16 timeoutPeriod; // timeout period
  385. uint8 *reportableChange; // reportable change (only applicable to analog data type)
  386. // - the size depends on the attribute data type
  387. } zclCfgReportRec_t;
  388. typedef struct
  389. {
  390. uint8 numAttr; // number of attribute IDs in the list
  391. zclCfgReportRec_t attrList[]; // attribute ID list
  392. } zclCfgReportCmd_t;
  393. // Attribute Status record
  394. typedef struct
  395. {
  396. uint8 status; // should be ZCL_STATUS_SUCCESS or error
  397. uint8 direction; // whether attributes are reported or reports of attributes are received
  398. uint16 attrID; // attribute ID
  399. } zclCfgReportStatus_t;
  400. // Configure Reporting Response Command format
  401. typedef struct
  402. {
  403. uint8 numAttr; // number of attribute status in the list
  404. zclCfgReportStatus_t attrList[]; // attribute status records
  405. } zclCfgReportRspCmd_t;
  406. // Read Reporting Configuration Command format
  407. typedef struct
  408. {
  409. uint8 direction; // to send or receive reports of the attribute
  410. uint16 attrID; // attribute ID
  411. } zclReadReportCfgRec_t;
  412. typedef struct
  413. {
  414. uint8 numAttr; // number of attributes in the list
  415. zclReadReportCfgRec_t attrList[]; // attribute ID list
  416. } zclReadReportCfgCmd_t;
  417. // Attribute Reporting Configuration record
  418. typedef struct
  419. {
  420. uint8 status; // status field
  421. uint8 direction; // to send or receive reports of the attribute
  422. uint16 attrID; // attribute ID
  423. uint8 dataType; // attribute data type
  424. uint16 minReportInt; // minimum reporting interval
  425. uint16 maxReportInt; // maximum reporting interval
  426. uint16 timeoutPeriod; // timeout period
  427. uint8 *reportableChange; // reportable change (only applicable to analog data type)
  428. // - the size depends on the attribute data type
  429. } zclReportCfgRspRec_t;
  430. // Read Reporting Configuration Response Command format
  431. typedef struct
  432. {
  433. uint8 numAttr; // number of records in the list
  434. zclReportCfgRspRec_t attrList[]; // attribute reporting configuration list
  435. } zclReadReportCfgRspCmd_t;
  436. // Attribute Report
  437. typedef struct
  438. {
  439. uint16 attrID; // atrribute ID
  440. uint8 dataType; // attribute data type
  441. uint8 *attrData; // this structure is allocated, so the data is HERE
  442. // - the size depends on the data type of attrID
  443. } zclReport_t;
  444. // Report Attributes Command format
  445. typedef struct
  446. {
  447. uint8 numAttr; // number of reports in the list
  448. zclReport_t attrList[]; // attribute report list
  449. } zclReportCmd_t;
  450. // Default Response Command format
  451. typedef struct
  452. {
  453. uint8 commandID;
  454. uint8 statusCode;
  455. } zclDefaultRspCmd_t;
  456. // Discover Attributes Command format
  457. typedef struct
  458. {
  459. uint16 startAttr; // specifies the minimum value of the identifier
  460. // to begin attribute discovery.
  461. uint8 maxAttrIDs; // maximum number of attribute IDs that are to be
  462. // returned in the resulting response command.
  463. } zclDiscoverCmd_t;
  464. // Attribute Report info
  465. typedef struct
  466. {
  467. uint16 attrID; // attribute ID
  468. uint8 dataType; // attribute data type (see Table 17 in Spec)
  469. } zclDiscoverInfo_t;
  470. // Discover Attributes Response Command format
  471. typedef struct
  472. {
  473. uint8 discComplete; // whether or not there're more attributes to be discovered
  474. uint8 numAttr; // number of attributes in the list
  475. zclDiscoverInfo_t attrList[]; // supported attributes list
  476. } zclDiscoverRspCmd_t;
  477. // String Data Type
  478. typedef struct
  479. {
  480. uint8 strLen;
  481. uint8 *pStr;
  482. } UTF8String_t;
  483. /*********************************************************************
  484. * Plugins
  485. */
  486. // Incoming ZCL message, this buffer will be allocated, cmd will point to the
  487. // the command record.
  488. typedef struct
  489. {
  490. afIncomingMSGPacket_t *msg; // incoming message
  491. zclFrameHdr_t hdr; // ZCL header parsed
  492. uint8 *pData; // pointer to data after header
  493. uint16 pDataLen; // length of remaining data
  494. void *attrCmd; // pointer to the parsed attribute or command
  495. } zclIncoming_t;
  496. // Outgoing ZCL Cluster Specific Commands
  497. typedef struct
  498. {
  499. zclFrameHdr_t hdr;
  500. uint16 realClusterID;
  501. uint16 attrID;
  502. void *cmdStruct;
  503. uint8 cmdLen;
  504. uint8 *cmdData;
  505. } zclOutgoingCmd_t;
  506. // Incoming ZCL message passed to the Application. This buffer will be
  507. // allocated and attrCmd will point to the command record.
  508. //
  509. // NOTE - the Application must deallocate the message plus attrCmd buffer.
  510. //
  511. typedef struct
  512. {
  513. osal_event_hdr_t hdr; // OSAL header
  514. zclFrameHdr_t zclHdr; // ZCL header parsed
  515. uint16 clusterId; // Cluster ID
  516. afAddrType_t srcAddr; // Sender's address
  517. uint8 endPoint; // destination endpoint
  518. void *attrCmd; // pointer to the parsed attribute or command; must be freed by Application
  519. } zclIncomingMsg_t;
  520. // Function pointer type to handle incoming messages.
  521. // msg - incoming message
  522. // logicalClusterID - logical cluster ID
  523. typedef ZStatus_t (*zclInHdlr_t)( zclIncoming_t *pInHdlrMsg );
  524. // Function pointer type to handle incoming write commands.
  525. // msg - incoming message
  526. // logicalClusterID - logical cluster ID
  527. // writeRec - received data to be written
  528. typedef ZStatus_t (*zclInWrtHdlr_t)( zclIncoming_t *msg, uint16 logicalClusterID, zclWriteRec_t *writeRec );
  529. // Attribute record
  530. typedef struct
  531. {
  532. uint16 attrId; // Attribute ID
  533. uint8 dataType; // Data Type - defined in AF.h
  534. uint8 accessControl; // Read/write - bit field
  535. void *dataPtr; // Pointer to data field
  536. } zclAttribute_t;
  537. typedef struct
  538. {
  539. uint16 clusterID; // Real cluster ID
  540. zclAttribute_t attr;
  541. } zclAttrRec_t;
  542. // Function pointer type to validate attribute data.
  543. //
  544. // pAttr - where data to be written
  545. // pAttrInfo - pointer to attribute info
  546. //
  547. // return TRUE if data valid. FALSE, otherwise.
  548. typedef uint8 (*zclValidateAttrData_t)( zclAttrRec_t *pAttr, zclWriteRec_t *pAttrInfo );
  549. // Function pointer type to read/write attribute data.
  550. //
  551. // clusterId - cluster that attribute belongs to
  552. // attrId - attribute to be read or written
  553. // oper - ZCL_OPER_LEN, ZCL_OPER_READ, or ZCL_OPER_WRITE
  554. // pValue - pointer to attribute (length) value
  555. // pLen - length of attribute value read
  556. //
  557. // return ZCL_STATUS_SUCCESS: Operation successful
  558. // ZCL Error Status: Operation not successful
  559. typedef ZStatus_t (*zclReadWriteCB_t)( uint16 clusterId, uint16 attrId, uint8 oper,
  560. uint8 *pValue, uint16 *pLen );
  561. // Callback function prototype to authorize a Read or Write operation
  562. // on a given attribute.
  563. //
  564. // srcAddr - source Address
  565. // pAttr - pointer to attribute
  566. // oper - ZCL_OPER_READ, or ZCL_OPER_WRITE
  567. //
  568. // return ZCL_STATUS_SUCCESS: Operation authorized
  569. // ZCL_STATUS_NOT_AUTHORIZED: Operation not authorized
  570. typedef ZStatus_t (*zclAuthorizeCB_t)( afAddrType_t *srcAddr, zclAttrRec_t *pAttr, uint8 oper );
  571. typedef struct
  572. {
  573. uint16 clusterID; // Real cluster ID
  574. uint8 option;
  575. } zclOptionRec_t;
  576. // Parse received command
  577. typedef struct
  578. {
  579. uint8 endpoint;
  580. uint16 dataLen;
  581. uint8 *pData;
  582. } zclParseCmd_t;
  583. /*********************************************************************
  584. * GLOBAL VARIABLES
  585. */
  586. extern uint8 zcl_TaskID;
  587. extern uint8 zcl_SeqNum;
  588. /*********************************************************************
  589. * FUNCTION MACROS
  590. */
  591. #ifdef ZCL_WRITE
  592. /*
  593. * Send a Write Command - ZCL_CMD_WRITE
  594. * Use like:
  595. * ZStatus_t zcl_SendWrite( uint8 srcEP, afAddrType_t *dstAddr, uint16 realClusterID, zclWriteCmd_t *writeCmd, uint8 direction, uint8 disableDefaultRsp, uint8 seqNum );
  596. */
  597. #define zcl_SendWrite(a,b,c,d,e,f,g) (zcl_SendWriteRequest( (a), (b), (c), (d), ZCL_CMD_WRITE, (e), (f), (g) ))
  598. /*
  599. * Send a Write Undivided Command - ZCL_CMD_WRITE_UNDIVIDED
  600. * Use like:
  601. * ZStatus_t zcl_SendWriteUndivided( uint8 srcEP, afAddrType_t *dstAddr, uint16 realClusterID, zclWriteCmd_t *writeCmd, uint8 direction, uint8 disableDefaultRsp, uint8 seqNum );
  602. */
  603. #define zcl_SendWriteUndivided(a,b,c,d,e,f,g) (zcl_SendWriteRequest( (a), (b), (c), (d), ZCL_CMD_WRITE_UNDIVIDED, (e), (f), (g) ))
  604. /*
  605. * Send a Write No Response Command - ZCL_CMD_WRITE_NO_RSP
  606. * Use like:
  607. * ZStatus_t zcl_SendWriteNoRsp( uint8 srcEP, afAddrType_t *dstAddr, uint16 realClusterID, zclWriteCmd_t *writeCmd, uint8 direction, uint8 disableDefaultRsp, uint8 seqNum );
  608. */
  609. #define zcl_SendWriteNoRsp(a,b,c,d,e,f,g) (zcl_SendWriteRequest( (a), (b), (c), (d), ZCL_CMD_WRITE_NO_RSP, (e), (f), (g) ))
  610. #endif // ZCL_WRITE
  611. /*********************************************************************
  612. * FUNCTIONS
  613. */
  614. /*
  615. * Initialization for the task
  616. */
  617. extern void zcl_Init( byte task_id );
  618. /*
  619. * Event Process for the task
  620. */
  621. extern UINT16 zcl_event_loop( byte task_id, UINT16 events );
  622. /*
  623. * Function for Plugins' to register for incoming messages
  624. */
  625. extern ZStatus_t zcl_registerPlugin( uint16 startLogCluster, uint16 endLogCluster,
  626. zclInHdlr_t pfnIncomingHdlr );
  627. /*
  628. * Register Application's Attribute table
  629. */
  630. extern ZStatus_t zcl_registerAttrList( uint8 endpoint, uint8 numAttr, CONST zclAttrRec_t attrList[] );
  631. /*
  632. * Register Application's Cluster Option table
  633. */
  634. extern ZStatus_t zcl_registerClusterOptionList( uint8 endpoint, uint8 numOption, zclOptionRec_t optionList[] );
  635. /*
  636. * Register Application's attribute data validation callback routine
  637. */
  638. extern ZStatus_t zcl_registerValidateAttrData( zclValidateAttrData_t pfnValidateAttrData );
  639. /*
  640. * Register the application's callback function to read/write attribute data.
  641. */
  642. extern ZStatus_t zcl_registerReadWriteCB( uint8 endpoint, zclReadWriteCB_t pfnReadWriteCB,
  643. zclAuthorizeCB_t pfnAuthorizeCB );
  644. /*
  645. * Register the Application to receive the unprocessed Foundation command/response messages
  646. */
  647. extern uint8 zcl_registerForMsg( uint8 taskId );
  648. /*
  649. * Function for Sending a Command
  650. */
  651. extern ZStatus_t zcl_SendCommand( uint8 srcEP, afAddrType_t *dstAddr,
  652. uint16 clusterID, uint8 cmd, uint8 specific, uint8 direction,
  653. uint8 disableDefaultRsp, uint16 manuCode, uint8 seqNum,
  654. uint16 cmdFormatLen, uint8 *cmdFormat );
  655. #ifdef ZCL_READ
  656. /*
  657. * Function for Reading an Attribute
  658. */
  659. extern ZStatus_t zcl_SendRead( uint8 srcEP, afAddrType_t *dstAddr,
  660. uint16 realClusterID, zclReadCmd_t *readCmd,
  661. uint8 direction, uint8 disableDefaultRsp, uint8 seqNum );
  662. /*
  663. * Function for sending a Read response command
  664. */
  665. extern ZStatus_t zcl_SendReadRsp( uint8 srcEP, afAddrType_t *dstAddr,
  666. uint16 realClusterID, zclReadRspCmd_t *readRspCmd,
  667. uint8 direction, uint8 disableDefaultRsp, uint8 seqNum );
  668. #endif // ZCL_READ
  669. #ifdef ZCL_WRITE
  670. /*
  671. * Function for Writing an Attribute
  672. */
  673. extern ZStatus_t zcl_SendWriteRequest( uint8 srcEP, afAddrType_t *dstAddr,
  674. uint16 realClusterID, zclWriteCmd_t *writeCmd,
  675. uint8 cmd, uint8 direction, uint8 disableDefaultRsp, uint8 seqNum );
  676. /*
  677. * Function for sending a Write response command
  678. */
  679. extern ZStatus_t zcl_SendWriteRsp( uint8 srcEP, afAddrType_t *dstAddr,
  680. uint16 realClusterID, zclWriteRspCmd_t *writeRspCmd,
  681. uint8 direction, uint8 disableDefaultRsp, uint8 seqNum );
  682. #endif // ZCL_WRITE
  683. #ifdef ZCL_REPORT
  684. /*
  685. * Function for Configuring the Reporting mechanism for one or more attributes
  686. */
  687. extern ZStatus_t zcl_SendConfigReportCmd( uint8 srcEP, afAddrType_t *dstAddr,
  688. uint16 realClusterID, zclCfgReportCmd_t *cfgReportCmd,
  689. uint8 direction, uint8 disableDefaultRsp, uint8 seqNum );
  690. /*
  691. * Function for sending a Configure Reporting Response Command
  692. */
  693. extern ZStatus_t zcl_SendConfigReportRspCmd( uint8 srcEP, afAddrType_t *dstAddr,
  694. uint16 realClusterID, zclCfgReportRspCmd_t *cfgReportRspCmd,
  695. uint8 direction, uint8 disableDefaultRsp, uint8 seqNum );
  696. /*
  697. * Function for Reading the configuration details of the Reporting mechanism
  698. */
  699. extern ZStatus_t zcl_SendReadReportCfgCmd( uint8 srcEP, afAddrType_t *dstAddr,
  700. uint16 realClusterID, zclReadReportCfgCmd_t *readReportCfgCmd,
  701. uint8 direction, uint8 disableDefaultRsp, uint8 seqNum );
  702. /*
  703. * Function for sending a Read Reporting Configuration Response command
  704. */
  705. extern ZStatus_t zcl_SendReadReportCfgRspCmd( uint8 srcEP, afAddrType_t *dstAddr,
  706. uint16 realClusterID, zclReadReportCfgRspCmd_t *readReportCfgRspCmd,
  707. uint8 direction, uint8 disableDefaultRsp, uint8 seqNum );
  708. /*
  709. * Function for Reporting the value of one or more attributes
  710. */
  711. extern ZStatus_t zcl_SendReportCmd( uint8 srcEP, afAddrType_t *dstAddr,
  712. uint16 realClusterID, zclReportCmd_t *reportCmd,
  713. uint8 direction, uint8 disableDefaultRsp, uint8 seqNum );
  714. #endif // ZCL_REPORT
  715. /*
  716. * Function for sending the Default Response command
  717. */
  718. extern ZStatus_t zcl_SendDefaultRspCmd( uint8 srcEP, afAddrType_t *dstAddr, uint16 realClusterID,
  719. zclDefaultRspCmd_t *defaultRspCmd, uint8 direction,
  720. uint8 disableDefaultRsp, uint16 manuCode, uint8 seqNum );
  721. #ifdef ZCL_DISCOVER
  722. /*
  723. * Function to Discover the ID and Types of the Attributes on a remote device
  724. */
  725. extern ZStatus_t zcl_SendDiscoverCmd( uint8 srcEP, afAddrType_t *dstAddr,
  726. uint16 realClusterID, zclDiscoverCmd_t *discoverCmd,
  727. uint8 direction, uint8 disableDefaultRsp, uint8 seqNum );
  728. /*
  729. * Function for sending the Discover Attributes Response command
  730. */
  731. extern ZStatus_t zcl_SendDiscoverRspCmd( uint8 srcEP, afAddrType_t *dstAddr,
  732. uint16 realClusterID, zclDiscoverRspCmd_t *discoverRspCmd,
  733. uint8 direction, uint8 disableDefaultRsp, uint8 seqNum );
  734. #endif // ZCL_DISCOVER
  735. #ifdef ZCL_READ
  736. /*
  737. * Function to parse the "Profile" Read Commands
  738. */
  739. extern void *zclParseInReadCmd( zclParseCmd_t *pCmd );
  740. #endif // ZCL_READ
  741. #ifdef ZCL_WRITE
  742. /*
  743. * Function to parse the "Profile" Write, Write Undivided and Write No Response
  744. * Commands
  745. */
  746. extern void *zclParseInWriteCmd( zclParseCmd_t *pCmd );
  747. #endif // ZCL_WRITE
  748. #ifdef ZCL_REPORT
  749. /*
  750. * Function to parse the "Profile" Configure Reporting Command
  751. */
  752. extern void *zclParseInConfigReportCmd( zclParseCmd_t *pCmd );
  753. /*
  754. * Function to parse the "Profile" Read Reporting Configuration Command
  755. */
  756. extern void *zclParseInReadReportCfgCmd( zclParseCmd_t *pCmd );
  757. /*
  758. * Function to parse the "Profile" Report attribute Command
  759. */
  760. extern void *zclParseInReportCmd( zclParseCmd_t *pCmd );
  761. /*
  762. * Function to check to see if Data Type is Analog
  763. */
  764. extern uint8 zclAnalogDataType( uint8 dataType );
  765. #endif // ZCL_REPORT
  766. #ifdef ZCL_DISCOVER
  767. /*
  768. * Function to parse the "Profile" Discover Commands
  769. */
  770. extern void *zclParseInDiscCmd( zclParseCmd_t *pCmd );
  771. #endif // ZCL_DISCOVER
  772. /*
  773. * Function to parse header of the ZCL format
  774. */
  775. extern uint8 *zclParseHdr( zclFrameHdr_t *hdr, uint8 *pData );
  776. /*
  777. * Function to find the attribute record that matchs the parameters
  778. */
  779. extern uint8 zclFindAttrRec( uint8 endpoint, uint16 realClusterID, uint16 attrId, zclAttrRec_t *pAttr );
  780. /*
  781. * Function to read the attribute's current value
  782. */
  783. extern uint8 zclReadAttrData( uint8 *pAttrData, zclAttrRec_t *pAttr, uint16 *pDataLen );
  784. /*
  785. * Function to return the length of the datatype in length.
  786. */
  787. extern uint8 zclGetDataTypeLength( uint8 dataType );
  788. /*
  789. * Function to serialize attribute data.
  790. */
  791. extern uint8 *zclSerializeData( uint8 dataType, void *attrData, uint8 *buf );
  792. /*
  793. * Function to return the length of the attribute.
  794. */
  795. extern uint16 zclGetAttrDataLength( uint8 dataType, uint8 *pData);
  796. /*
  797. * Call to get original unprocessed AF message (not parsed by ZCL).
  798. *
  799. * NOTE: This function can only be called during a ZCL callback function
  800. * and the calling function must NOT change any data in the message.
  801. *
  802. * returns a pointer to original AF message, NULL if not processing
  803. * AF message.
  804. */
  805. extern afIncomingMSGPacket_t *zcl_getRawAFMsg( void );
  806. /*********************************************************************
  807. *********************************************************************/
  808. #ifdef __cplusplus
  809. }
  810. #endif
  811. #endif /* ZCL_H */