zcl_general.h 84 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887
  1. /**************************************************************************************************
  2. Filename: zcl_general.h
  3. Revised: $Date: 2011-12-14 16:30:16 -0800 (Wed, 14 Dec 2011) $
  4. Revision: $Revision: 28678 $
  5. Description: This file contains the ZCL General 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_GENERAL_H
  34. #define ZCL_GENERAL_H
  35. #ifdef __cplusplus
  36. extern "C"
  37. {
  38. #endif
  39. /*********************************************************************
  40. * INCLUDES
  41. */
  42. #include "zcl.h"
  43. /*********************************************************************
  44. * CONSTANTS
  45. */
  46. #define ZCL_SCENE_NAME_LEN 16
  47. /********************************/
  48. /*** Basic Cluster Attributes ***/
  49. /********************************/
  50. // Basic Device Information
  51. #define ATTRID_BASIC_ZCL_VERSION 0x0000
  52. #define ATTRID_BASIC_APPL_VERSION 0x0001
  53. #define ATTRID_BASIC_STACK_VERSION 0x0002
  54. #define ATTRID_BASIC_HW_VERSION 0x0003
  55. #define ATTRID_BASIC_MANUFACTURER_NAME 0x0004
  56. #define ATTRID_BASIC_MODEL_ID 0x0005
  57. #define ATTRID_BASIC_DATE_CODE 0x0006
  58. #define ATTRID_BASIC_POWER_SOURCE 0x0007
  59. // Basic Device Settings
  60. #define ATTRID_BASIC_LOCATION_DESC 0x0010
  61. #define ATTRID_BASIC_PHYSICAL_ENV 0x0011
  62. #define ATTRID_BASIC_DEVICE_ENABLED 0x0012
  63. #define ATTRID_BASIC_ALARM_MASK 0x0013
  64. /*** Power Source Attribute values ***/
  65. // Bits b0-b6 represent the primary power source of the device
  66. #define POWER_SOURCE_UNKNOWN 0x00
  67. #define POWER_SOURCE_MAINS_1_PHASE 0x01
  68. #define POWER_SOURCE_MAINS_3_PHASE 0x02
  69. #define POWER_SOURCE_BATTERY 0x03
  70. #define POWER_SOURCE_DC 0x04
  71. #define POWER_SOURCE_EMERG_MAINS_CONST_PWR 0x05
  72. #define POWER_SOURCE_EMERG_MAINS_XFER_SW 0x06
  73. // Bit b7 indicates whether the device has a secondary power source in the
  74. // form of a battery backup
  75. /*** Power Source Attribute bits ***/
  76. #define POWER_SOURCE_PRIMARY 0x7F
  77. #define POWER_SOURCE_SECONDARY 0x80
  78. /*** Physical Environment Attribute values ***/
  79. #define PHY_UNSPECIFIED_ENV 0x00
  80. #define PHY_MIRROR_CAPACITY_ENV 0x01
  81. // Specified per Profile 0x01-0x7F
  82. #define PHY_UNKNOWN_ENV 0xFF
  83. /*** Device Enable Attribute values ***/
  84. #define DEVICE_DISABLED 0x00
  85. #define DEVICE_ENABLED 0x01
  86. /*** Alarm Mask Attribute bits ***/
  87. #define ALARM_MASK_GEN_HW_FAULT 0x01
  88. #define ALARM_MASK_GEN_SW_FAULT 0x02
  89. /******************************/
  90. /*** Basic Cluster Commands ***/
  91. /******************************/
  92. #define COMMAND_BASIC_RESET_FACT_DEFAULT 0x00
  93. /**********************************************/
  94. /*** Power Configuration Cluster Attributes ***/
  95. /**********************************************/
  96. // Mains Information
  97. #define ATTRID_POWER_CFG_MAINS_VOLTAGE 0x0000
  98. #define ATTRID_POWER_CFG_MAINS_FREQUENCY 0x0001
  99. // Mains Settings
  100. #define ATTRID_POWER_CFG_MAINS_ALARM_MASK 0x0010
  101. #define ATTRID_POWER_CFG_MAINS_VOLT_MIN_THRES 0x0011
  102. #define ATTRID_POWER_CFG_MAINS_VOLT_MAX_THRES 0x0012
  103. #define ATTRID_POWER_CFG_MAINS_DWELL_TRIP_POINT 0x0013
  104. // Battery Information
  105. #define ATTRID_POWER_CFG_BATTERY_VOLTAGE 0x0020
  106. // Battery Settings
  107. #define ATTRID_POWER_CFG_BAT_MANU 0x0030
  108. #define ATTRID_POWER_CFG_BAT_SIZE 0x0031
  109. #define ATTRID_POWER_CFG_BAT_AHR_RATING 0x0032
  110. #define ATTRID_POWER_CFG_BAT_QUANTITY 0x0033
  111. #define ATTRID_POWER_CFG_BAT_RATED_VOLTAGE 0x0034
  112. #define ATTRID_POWER_CFG_BAT_ALARM_MASK 0x0035
  113. #define ATTRID_POWER_CFG_BAT_VOLT_MIN_THRES 0x0036
  114. /*** Mains Alarm Mask Attribute bit ***/
  115. #define MAINS_ALARM_MASK_VOLT_2_LOW 0x01
  116. #define MAINS_ALARM_MASK_VOLT_2_HI 0x02
  117. /*** Battery Size Attribute values ***/
  118. #define BAT_SIZE_NO_BATTERY 0x00
  119. #define BAT_SIZE_BUILT_IN 0x01
  120. #define BAT_SIZE_OTHER 0x02
  121. #define BAT_SIZE_AA 0x03
  122. #define BAT_SIZE_AAA 0x04
  123. #define BAT_SIZE_C 0x05
  124. #define BAT_SIZE_D 0x06
  125. #define BAT_SIZE_UNKNOWN 0xFF
  126. /*** Batter Alarm Mask Attribute bit ***/
  127. #define BAT_ALARM_MASK_VOLT_2_LOW 0x01
  128. /********************************************/
  129. /*** Power Configuration Cluster Commands ***/
  130. /********************************************/
  131. // No cluster specific commands
  132. /***********************************************************/
  133. /*** Device Temperature Configuration Cluster Attributes ***/
  134. /***********************************************************/
  135. // Device Temperature Information
  136. #define ATTRID_DEV_TEMP_CURRENT 0x0000
  137. #define ATTRID_DEV_TEMP_MIN_EXPERIENCED 0x0001
  138. #define ATTRID_DEV_TEMP_MAX_EXPERIENCED 0x0002
  139. #define ATTRID_DEV_TEMP_OVER_TOTAL_DWELL 0x0003
  140. // Device Temperature Settings
  141. #define ATTRID_DEV_TEMP_ALARM_MASK 0x0010
  142. #define ATTRID_DEV_TEMP_LOW_THRES 0x0011
  143. #define ATTRID_DEV_TEMP_HI_THRES 0x0012
  144. #define ATTRID_DEV_TEMP_LOW_DWELL_TRIP_POINT 0x0013
  145. #define ATTRID_DEV_TEMP_HI_DWELL_TRIP_POINT 0x0014
  146. /*** Device Temp Alarm_Mask Attribute bits ***/
  147. #define DEV_TEMP_ALARM_MASK_2_LOW 0x01
  148. #define DEV_TEMP_ALARM_MASK_2_HI 0x02
  149. /*********************************************************/
  150. /*** Device Temperature Configuration Cluster Commands ***/
  151. /*********************************************************/
  152. // No cluster specific commands
  153. /***********************************/
  154. /*** Identify Cluster Attributes ***/
  155. /***********************************/
  156. #define ATTRID_IDENTIFY_TIME 0x0000
  157. /*********************************/
  158. /*** Identify Cluster Commands ***/
  159. /*********************************/
  160. #define COMMAND_IDENTIFY 0x00
  161. #define COMMAND_IDENTIFY_QUERY 0x01
  162. #define COMMAND_IDENTIFY_QUERY_RSP 0x00
  163. /********************************/
  164. /*** Group Cluster Attributes ***/
  165. /********************************/
  166. #define ATTRID_GROUP_NAME_SUPPORT 0x0000
  167. /******************************/
  168. /*** Group Cluster Commands ***/
  169. /******************************/
  170. #define COMMAND_GROUP_ADD 0x00
  171. #define COMMAND_GROUP_VIEW 0x01
  172. #define COMMAND_GROUP_GET_MEMBERSHIP 0x02
  173. #define COMMAND_GROUP_REMOVE 0x03
  174. #define COMMAND_GROUP_REMOVE_ALL 0x04
  175. #define COMMAND_GROUP_ADD_IF_IDENTIFYING 0x05
  176. #define COMMAND_GROUP_ADD_RSP 0x00
  177. #define COMMAND_GROUP_VIEW_RSP 0x01
  178. #define COMMAND_GROUP_GET_MEMBERSHIP_RSP 0x02
  179. #define COMMAND_GROUP_REMOVE_RSP 0x03
  180. /*********************************/
  181. /*** Scenes Cluster Attributes ***/
  182. /*********************************/
  183. // Scene Management Information
  184. #define ATTRID_SCENES_COUNT 0x0000
  185. #define ATTRID_SCENES_CURRENT_SCENE 0x0001
  186. #define ATTRID_SCENES_CURRENT_GROUP 0x0002
  187. #define ATTRID_SCENES_SCENE_VALID 0x0003
  188. #define ATTRID_SCENES_NAME_SUPPORT 0x0004
  189. #define ATTRID_SCENES_LAST_CFG_BY 0x0005
  190. /*******************************/
  191. /*** Scenes Cluster Commands ***/
  192. /*******************************/
  193. #define COMMAND_SCENE_ADD 0x00
  194. #define COMMAND_SCENE_VIEW 0x01
  195. #define COMMAND_SCENE_REMOVE 0x02
  196. #define COMMAND_SCENE_REMOVE_ALL 0x03
  197. #define COMMAND_SCENE_STORE 0x04
  198. #define COMMAND_SCENE_RECALL 0x05
  199. #define COMMAND_SCENE_GET_MEMBERSHIP 0x06
  200. #define COMMAND_SCENE_ADD_RSP 0x00
  201. #define COMMAND_SCENE_VIEW_RSP 0x01
  202. #define COMMAND_SCENE_REMOVE_RSP 0x02
  203. #define COMMAND_SCENE_REMOVE_ALL_RSP 0x03
  204. #define COMMAND_SCENE_STORE_RSP 0x04
  205. #define COMMAND_SCENE_GET_MEMBERSHIP_RSP 0x06
  206. /*********************************/
  207. /*** On/Off Cluster Attributes ***/
  208. /*********************************/
  209. #define ATTRID_ON_OFF 0x0000
  210. /*******************************/
  211. /*** On/Off Cluster Commands ***/
  212. /*******************************/
  213. #define COMMAND_OFF 0x00
  214. #define COMMAND_ON 0x01
  215. #define COMMAND_TOGGLE 0x02
  216. /****************************************/
  217. /*** On/Off Switch Cluster Attributes ***/
  218. /****************************************/
  219. // Switch Information
  220. #define ATTRID_ON_OFF_SWITCH_TYPE 0x0000
  221. // Switch Settings
  222. #define ATTRID_ON_OFF_SWITCH_ACTIONS 0x0010
  223. /*** On Off Switch Type attribute values ***/
  224. #define ON_OFF_SWITCH_TYPE_TOGGLE 0x00
  225. #define ON_OFF_SWITCH_TYPE_MOMENTARY 0x01
  226. /*** On Off Switch Actions attribute values ***/
  227. #define ON_OFF_SWITCH_ACTIONS_0 0x00
  228. #define ON_OFF_SWITCH_ACTIONS_1 0x01
  229. #define ON_OFF_SWITCH_ACTIONS_2 0x02
  230. /**************************************/
  231. /*** On/Off Switch Cluster Commands ***/
  232. /**************************************/
  233. // No cluster specific commands
  234. /****************************************/
  235. /*** Level Control Cluster Attributes ***/
  236. /****************************************/
  237. #define ATTRID_LEVEL_CURRENT_LEVEL 0x0000
  238. #define ATTRID_LEVEL_REMAINING_TIME 0x0001
  239. #define ATTRID_LEVEL_ON_OFF_TRANSITION_TIME 0x0010
  240. #define ATTRID_LEVEL_ON_LEVEL 0x0011
  241. /**************************************/
  242. /*** Level Control Cluster Commands ***/
  243. /**************************************/
  244. #define COMMAND_LEVEL_MOVE_TO_LEVEL 0x00
  245. #define COMMAND_LEVEL_MOVE 0x01
  246. #define COMMAND_LEVEL_STEP 0x02
  247. #define COMMAND_LEVEL_STOP 0x03
  248. #define COMMAND_LEVEL_MOVE_TO_LEVEL_WITH_ON_OFF 0x04
  249. #define COMMAND_LEVEL_MOVE_WITH_ON_OFF 0x05
  250. #define COMMAND_LEVEL_STEP_WITH_ON_OFF 0x06
  251. #define COMMAND_LEVEL_STOP_WITH_ON_OFF 0x07
  252. /*** Level Control Move (Mode) Command values ***/
  253. #define LEVEL_MOVE_UP 0x00
  254. #define LEVEL_MOVE_DOWN 0x01
  255. /*** Level Control Step (Mode) Command values ***/
  256. #define LEVEL_STEP_UP 0x00
  257. #define LEVEL_STEP_DOWN 0x01
  258. /*********************************/
  259. /*** Alarms Cluster Attributes ***/
  260. /*********************************/
  261. // Alarm Information
  262. #define ATTRID_ALARM_COUNT 0x0000
  263. /*******************************/
  264. /*** Alarms Cluster Commands ***/
  265. /*******************************/
  266. #define COMMAND_ALARMS_RESET 0x00
  267. #define COMMAND_ALARMS_RESET_ALL 0x01
  268. #define COMMAND_ALARMS_GET 0x02
  269. #define COMMAND_ALARMS_RESET_LOG 0x03
  270. #define COMMAND_ALARMS_PUBLISH_EVENT_LOG 0x04
  271. #define COMMAND_ALARMS_ALARM 0x00
  272. #define COMMAND_ALARMS_GET_RSP 0x01
  273. #define COMMAND_ALARMS_GET_EVENT_LOG 0x02
  274. /*******************************/
  275. /*** Time Cluster Attributes ***/
  276. /*******************************/
  277. #define ATTRID_TIME_TIME 0x00
  278. #define ATTRID_TIME_STATUS 0x01
  279. #define ATTRID_TIME_ZONE 0x02
  280. #define ATTRID_TIME_DST_START 0x03
  281. #define ATTRID_TIME_DST_END 0x04
  282. #define ATTRID_TIME_DST_SHIFT 0x05
  283. #define ATTRID_TIME_STANDARD_TIME 0x06
  284. #define ATTRID_TIME_LOCAL_TIME 0x07
  285. #define ATTRID_TIME_LAST_SET_TIME 0x08
  286. #define ATTRID_TIME_VALID_UNTIL_TIME 0x09
  287. /*** TimeStatus Attribute bits ***/
  288. #define TIME_STATUS_MASTER 0x01
  289. #define TIME_STATUS_SYNCH 0x02
  290. #define TIME_STATUS_MASTER_ZONE_DST 0x04
  291. /*****************************/
  292. /*** Time Cluster Commands ***/
  293. /*****************************/
  294. // No cluster specific commands
  295. /***********************************/
  296. /*** RSSI Location Cluster Attributes ***/
  297. /***********************************/
  298. // Location Information
  299. #define ATTRID_LOCATION_TYPE 0x0000
  300. #define ATTRID_LOCATION_METHOD 0x0001
  301. #define ATTRID_LOCATION_AGE 0x0002
  302. #define ATTRID_LOCATION_QUALITY_MEASURE 0x0003
  303. #define ATTRID_LOCATION_NUM_DEVICES 0x0004
  304. // Location Settings
  305. #define ATTRID_LOCATION_COORDINATE1 0x0010
  306. #define ATTRID_LOCATION_COORDINATE2 0x0011
  307. #define ATTRID_LOCATION_COORDINATE3 0x0012
  308. #define ATTRID_LOCATION_POWER 0x0013
  309. #define ATTRID_LOCATION_PATH_LOSS_EXPONENT 0x0014
  310. #define ATTRID_LOCATION_REPORT_PERIOD 0x0015
  311. #define ATTRID_LOCATION_CALC_PERIOD 0x0016
  312. #define ATTRID_LOCATION_NUM_RSSI_MEASUREMENTS 0x0017
  313. /*** Location Type attribute bits ***/
  314. #define LOCATION_TYPE_ABSOLUTE 0x01
  315. #define LOCATION_TYPE_2_D 0x02
  316. #define LOCATION_TYPE_COORDINATE_SYSTEM 0x0C
  317. /*** Location Method attribute values ***/
  318. #define LOCATION_METHOD_LATERATION 0x00
  319. #define LOCATION_METHOD_SIGNPOSTING 0x01
  320. #define LOCATION_METHOD_RF_FINGER_PRINT 0x02
  321. #define LOCATION_METHOD_OUT_OF_BAND 0x03
  322. /*********************************/
  323. /*** Location Cluster Commands ***/
  324. /*********************************/
  325. #define COMMAND_LOCATION_SET_ABSOLUTE 0x00
  326. #define COMMAND_LOCATION_SET_DEV_CFG 0x01
  327. #define COMMAND_LOCATION_GET_DEV_CFG 0x02
  328. #define COMMAND_LOCATION_GET_DATA 0x03
  329. #define COMMAND_LOCATION_DEV_CFG_RSP 0x00
  330. #define COMMAND_LOCATION_DATA_RSP 0x01
  331. #define COMMAND_LOCATION_DATA_NOTIF 0x02
  332. #define COMMAND_LOCATION_COMPACT_DATA_NOTIF 0x03
  333. #define COMMAND_LOCATION_RSSI_PING 0x04
  334. /**********************************************************/
  335. /*** Input, Output and Value (Basic) Cluster Attributes ***/
  336. /**********************************************************/
  337. #define ATTRID_IOV_BASIC_ACTIVE_TEXT 0x0004
  338. #define ATTRID_IOV_BASIC_STATE_TEXT 0x000E
  339. #define ATTRID_IOV_BASIC_DESCRIPTION 0x001C
  340. #define ATTRID_IOV_BASIC_INACTIVE_TEXT 0x002E
  341. #define ATTRID_IOV_BASIC_MAX_PRESENT_VALUE 0x0041
  342. #define ATTRID_IOV_BASIC_MIN_OFF_TIME 0x0042
  343. #define ATTRID_IOV_BASIC_MIM_ON_TIME 0x0043
  344. #define ATTRID_IOV_BASIC_MIN_PRESENT_VALUE 0x0045
  345. #define ATTRID_IOV_BASIC_NUM_OF_STATES 0x004A
  346. #define ATTRID_IOV_BASIC_OUT_OF_SERVICE 0x0051
  347. #define ATTRID_IOV_BASIC_POLARITY 0x0054
  348. #define ATTRID_IOV_BASIC_PRESENT_VALUE 0x0055
  349. #define ATTRID_IOV_BASIC_PRIORITY_ARRAY 0x0057
  350. #define ATTRID_IOV_BASIC_RELIABILITY 0x0067
  351. #define ATTRID_IOV_BASIC_RELINQUISH_DEFAULT 0x0068
  352. #define ATTRID_IOV_BASIC_RESOLUTION 0x006A
  353. #define ATTRID_IOV_BASIC_STATUS_FLAG 0x006F
  354. #define ATTRID_IOV_BASIC_ENGINEERING_UNITS 0x0075
  355. #define ATTRID_IOV_BASIC_APP_TYPE 0x0100
  356. /*** StatusFlags attribute bits ***/
  357. #define STATUS_FLAGS_IN_ALARM 0x01
  358. #define STATUS_FLAGS_FAULT 0x02
  359. #define STATUS_FLAGS_OVERRIDDEN 0x04
  360. #define STATUS_FLAGS_OUT_OF_SERVICE 0x08
  361. /*** Reliability attribute types ***/
  362. #define RELIABILITY_NO_FAULT_DETECTED 0x00
  363. #define RELIABILITY_NO_SENSOR 0x01
  364. #define RELIABILITY_OVER_RANGE 0x02
  365. #define RELIABILITY_UNDER_RANGE 0x03
  366. #define RELIABILITY_OPEN_LOOP 0x04
  367. #define RELIABILITY_SHORTED_LOOP 0x05
  368. #define RELIABILITY_NO_OUTPUT 0x06
  369. #define RELIABILITY_UNRELIABLE_OTHER 0x07
  370. #define RELIABILITY_PROCESS_ERROR 0x08
  371. #define RELIABILITY_MULTI_STATE_FAULT 0x09
  372. #define RELIABILITY_CONFIG_ERROR 0x0A
  373. /*** EngineeringUnits attribute values ***/
  374. // Values 0x0000 to 0x00fe are reserved for the list of engineering units with
  375. // corresponding values specified in Clause 21 of the BACnet standard.
  376. #define ENGINEERING_UNITS_OTHER 0x00FF
  377. // Values 0x0100 to 0xffff are available for proprietary use.
  378. /*** Polarity attribute values ***/
  379. #define POLARITY_NORMAL 0x00
  380. #define POLARITY_REVERSE 0x01
  381. /*** ApplicationType attribute bits ***/
  382. // ApplicationType is subdivided into Group, Type and an Index number.
  383. // Application Group = Bits 24 - 31. An indication of the cluster this
  384. // attribute is part of.
  385. #define APP_GROUP 0xFF000000
  386. // Application Type = Bits 16 - 23. For Analog clusters, the physical
  387. // quantity that the Present Value attribute of the cluster represents.
  388. // For Binary and Multistate clusters, the application usage domain.
  389. #define APP_TYPE 0x00FF0000
  390. // Application Index = Bits 0 - 15. The specific application usage of
  391. // the cluster
  392. #define APP_INDEX 0x0000FFFF
  393. /*** Application Groups ***/
  394. #define APP_GROUP_AI 0x00 // Analog Input
  395. #define APP_GROUP_AO 0x01 // Analog Output
  396. #define APP_GROUP_AV 0x02 // Analog Value
  397. #define APP_GROUP_BI 0x03 // Binary Input
  398. #define APP_GROUP_BO 0x04 // Binary Output
  399. #define APP_GROUP_BV 0x05 // Binary Value
  400. #define APP_GROUP_MI 0x0D // Multistate Input
  401. #define APP_GROUP_MO 0x0E // Multistate Output
  402. #define APP_GROUP_MV 0x13 // Multistate Value
  403. /*** Application Types ***/
  404. // Analog Input (AI) Types:
  405. // Group = 0x00.
  406. // Types = 0x00 - 0x0E.
  407. // Types 0x0F to 0xFE are reserved, Type = 0xFF indicates other.
  408. #define APP_TYPE_AI_TEMP_C 0x00 // Temperature in degrees C
  409. #define APP_TYPE_AI_HUMIDITY_PERCENT 0x01 // Relative humidity in %
  410. #define APP_TYPE_AI_PRESSURE_PASCAL 0x02 // Pressure in Pascal
  411. #define APP_TYPE_AI_FLOW_LIT_SEC 0x03 // Flow in liters/second
  412. #define APP_TYPE_AI_PERCENT 0x04 // Percentage %
  413. #define APP_TYPE_AI_PARTS_PER_MIL 0x05 // Parts per Million PPM
  414. #define APP_TYPE_AI_ROTATION_SPEED 0x06 // Rotational Speed in RPM
  415. #define APP_TYPE_AI_CURRENT_AMPS 0x07 // Current in Amps
  416. #define APP_TYPE_AI_FREQUENCY_HZ 0x08 // Frequency in Hz
  417. #define APP_TYPE_AI_PWR_WATTS 0x09 // Power in Watts
  418. #define APP_TYPE_AI_PWR_KW 0x0A // Power in kW
  419. #define APP_TYPE_AI_ENERGY_KWH 0x0B // Energy in kWH
  420. #define APP_TYPE_AI_COUNT 0x0C // Count - Unitless
  421. #define APP_TYPE_AI_ENTHALPY_KJ_KG 0x0D // Enthalpy in KJoules/Kg
  422. #define APP_TYPE_AI_TIME_SEC 0x0E // Time in Seconds
  423. // Analog Output (AO) Types:
  424. // Group = 0x01.
  425. // Types = 0x00 - 0x0E.
  426. // Types 0x0F to 0xFE are reserved, Type = 0xFF indicates other.
  427. #define APP_TYPE_AO_TEMP_C 0x00 // Temperature in degrees C
  428. #define APP_TYPE_AO_HUMIDITY_PERCENT 0x01 // Relative Humidity in %
  429. #define APP_TYPE_AO_PRESSURE_PASCAL 0x02 // Pressure in Pascal
  430. #define APP_TYPE_AO_FLOW_LIT_SEC 0x03 // Flow in liters/second
  431. #define APP_TYPE_AO_PERCENT 0x04 // Percentage %
  432. #define APP_TYPE_AO_PARTS_PER_MIL 0x05 // Parts per Million PPM
  433. #define APP_TYPE_AO_ROTATION_SPEED 0x06 // Rotational Speed in RPM
  434. #define APP_TYPE_AO_CURRENT_AMPS 0x07 // Current in Amps
  435. #define APP_TYPE_AO_FREQUENCY_HZ 0x08 // Frequency in Hz
  436. #define APP_TYPE_AO_PWR_WATTS 0x09 // Power in Watts
  437. #define APP_TYPE_AO_PWR_KW 0x0A // Power in kW
  438. #define APP_TYPE_AO_ENERGY_KWH 0x0B // Energy in kWH
  439. #define APP_TYPE_AO_COUNT 0x0C // Count - Unitless
  440. #define APP_TYPE_AO_ENTHALPY_KJ_KG 0x0D // Enthalpy in KJoules/Kg
  441. #define APP_TYPE_AO_TIME_SEC 0x0E // Time in Seconds
  442. // Analog Value (AV) Types:
  443. // Group = 0x02.
  444. // Types = 0x00 - 0x03.
  445. // Types 0x04 to 0xFE are reserved, Type = 0xFF indicates other.
  446. #define APP_TYPE_AV_TEMP_C 0x00 // Temperature in Degrees C
  447. #define APP_TYPE_AV_AREA_SQ_METER 0x01 // Area in Square Metres
  448. #define APP_TYPE_AV_MULTIPLIER_NUM 0x02 // Multiplier - Number
  449. #define APP_TYPE_AV_FLOW_LIT_SEC 0x03 // Flow in Litres/Second
  450. // Binary Input (BI) Types:
  451. // Group = 0x03.
  452. // Types = 0x00 - 0x01.
  453. // Types 0x02 to 0xFE are reserved, Type = 0xFF indicates other.
  454. // Present Value = 0 represents False, Off, Normal
  455. // Present Value = 1 represents True, On, Alarm
  456. #define APP_TYPE_BI_DOMAIN_HVAC 0x00 // Application Domain HVAC
  457. #define APP_TYPE_BI_DOMAIN_SEC 0x01 // Application Domain Security
  458. // Binary Output (BO) Types:
  459. // Group = 0x04.
  460. // Types = 0x00 - 0x01.
  461. // Types 0x02 to 0xFE are reserved, Type = 0xFF indicates other.
  462. // Present Value = 0 represents False, Off, Normal
  463. // Present Value = 1 represents True, On, Alarm
  464. #define APP_TYPE_BO_DOMAIN_HVAC 0x00 // Application Domain HVAC
  465. #define APP_TYPE_BO_DOMAIN_SEC 0x02 // Application Domain Security
  466. // Binary Value (BV) Types:
  467. // Group = 0x05.
  468. // Type = 0x00.
  469. // Types 0x01 to 0xFE are reserved, Type = 0xFF indicates other.
  470. // Present Value = 0 represents False, Off, Normal
  471. // Present Value = 1 represents True, On, Alarm
  472. #define APP_TYPE_BV 0x00 // Type = 0x00
  473. // Multistate Input (MI) Types:
  474. // Group = 0x0D.
  475. // Type = 0x00.
  476. // Types 0x01 to 0xFE are reserved, Type = 0xFF indicates other.
  477. #define APP_TYPE_MI_DOMAIN_HVAC 0x00 // Application Domain HVAC
  478. // Multistate Output (MO) Types:
  479. // Group = 0x0E.
  480. // Type = 0x00.
  481. // Types 0x01 to 0xFE are reserved, Type = 0xFF indicates other.
  482. #define APP_TYPE_MO_DOMAIN_HVAC 0x00 // Application Domain HVAC
  483. // Multistate Value (MV) Types:
  484. // Group = 0x13.
  485. // Type = 0x00.
  486. // Types 0x01 to 0xFE are reserved, Type = 0xFF indicates other.
  487. #define APP_TYPE_MV_DOMAIN_HVAC 0x00 // Application Domain HVAC
  488. /*** Application Indexes ***/
  489. // Analog Input (AI) Indexes
  490. // Group = 0x00.
  491. // AI Temperature in degrees C Indexes:
  492. // Type = 0x00.
  493. // Indexes = 0x0000 - 0x003C.
  494. // Indexed 0x003D - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  495. // defined, Index = 0xFFFF indicates other.
  496. #define APP_INDEX_AI_TEMP_2_PIPE_ENTER_WATER 0x00 // 2 Pipe Entering Water Temperature AI
  497. // AI Relative humidity in % Indexes:
  498. // Type = 0x01.
  499. // Indexes = 0x0000 - 0x0008.
  500. // Indexed 0x0009 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  501. // defined, Index = 0xFFFF indicates other.
  502. #define APP_INDEX_AI_HUMIDITY_DISCHARGE 0x00 // Discharge Humidity AI
  503. // AI Pressure in Pascal Indexes:
  504. // Type = 0x02.
  505. // Indexes = 0x0000 - 0x001E.
  506. // Indexed 0x001F - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  507. // defined, Index = 0xFFFF indicates other.
  508. #define APP_INDEX_AI_PRESSURE_BOIL_PUMP_DIFF 0x00 // Boiler Pump Differential Pressure AI
  509. // AI Flow in liters/second Indexes:
  510. // Type = 0x03.
  511. // Indexes = 0x0000 - 0x0015.
  512. // Indexed 0x0016 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  513. // defined, Index = 0xFFFF indicates other.
  514. #define APP_INDEX_AI_FLOW_CHILLED_WATER 0x00 // Chilled Water Flow AI
  515. // AI Percentage % Indexes:
  516. // Type = 0x04.
  517. // Index = 0x0000.
  518. // Indexed 0x0001 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  519. // defined, Index = 0xFFFF indicates other.
  520. #define APP_INDEX_AI_PERCENT_CHILLER_FULL_LOAD_AMP 0x00 // Chiller % Full Load Amperage AI
  521. // AI Parts per Million PPM Indexes:
  522. // Type = 0x05.
  523. // Indexes = 0x0000 - 0x0001.
  524. // Indexed 0x0002 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  525. // defined, Index = 0xFFFF indicates other.
  526. #define APP_INDEX_AI_PARTS_RETURN_CO2 0x00 // Return Carbon Dioxide AI
  527. // AI Rotational Speed in RPM Indexes:
  528. // Type = 0x06.
  529. // Indexes = 0x0000 - 0x0007.
  530. // Indexed 0x0008 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  531. // defined, Index = 0xFFFF indicates other.
  532. #define APP_INDEX_AI_ROTATION_EXHAUST_FAN_REMOTE 0x00 // Exhaust Fan Remote Speed AI
  533. // AI Current in Amps Indexes:
  534. // Type = 0x07.
  535. // Index = 0x0000.
  536. // Indexed 0x0001 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  537. // defined, Index = 0xFFFF indicates other.
  538. #define APP_INDEX_AI_CURRENT_AMPS_CHILLER 0x00 // Chiller Amps AI
  539. // AI Frequency in Hz Indexes:
  540. // Type = 0x08.
  541. // Index = 0x0000.
  542. // Indexed 0x0001 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  543. // defined, Index = 0xFFFF indicates other.
  544. #define APP_INDEX_AI_FREQUENCY_SPEED_DRIVE_OUTPUT 0x00 // Variable Speed Drive Output Frequency AI
  545. // AI Power in Watts Indexes:
  546. // Type = 0x09.
  547. // Index = 0x0000.
  548. // Indexed 0x0001 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  549. // defined, Index = 0xFFFF indicates other.
  550. #define APP_INDEX_AI_PWR_WATTS_CONSUMPTION 0x00 // Power Consumption AI
  551. // AI Power in kW Indexes:
  552. // Type = 0x0A.
  553. // Indexes = 0x0000 - 0x0001.
  554. // Indexed 0x0002 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  555. // defined, Index = 0xFFFF indicates other.
  556. #define APP_INDEX_AI_PWR_KW_ABSOLUTE 0x00 // Absolute Power AI
  557. // AI Energy in kWH Indexes:
  558. // Type = 0x0B.
  559. // Index = 0x0000.
  560. // Indexed 0x0001 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  561. // defined, Index = 0xFFFF indicates other.
  562. #define APP_INDEX_AI_ENERGY_KWH_SPEED_DRIVE 0x00 // Variable Speed Drive Kilowatt Hours AI
  563. // AI Count - Unitless Indexes:
  564. // Type = 0x0C.
  565. // Index = 0x0000.
  566. // Indexed 0x0001 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  567. // defined, Index = 0xFFFF indicates other.
  568. #define APP_INDEX_AI_COUNT 0x00 // Count
  569. // AI Enthalpy in KJoules/Kg Indexes:
  570. // Type = 0x0D.
  571. // Indexes = 0x0000 - 0x0002.
  572. // Indexed 0x0003 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  573. // defined, Index = 0xFFFF indicates other.
  574. #define APP_INDEX_AI_ENTHALPY_OUTDOOR_AIR 0x00 // Outdoor Air Enthalpy AI
  575. // AI Time in Seconds Indexes:
  576. // Type = 0x0E.
  577. // Index = 0x0000.
  578. // Indexed 0x0001 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  579. // defined, Index = 0xFFFF indicates other.
  580. #define APP_INDEX_AI_TIME_RELATIVE 0x00 // Relative time AI
  581. // Analog Output (AO) types
  582. // Group = 0x01.
  583. // AO Temperature in degrees C Indexes:
  584. // Type = 0x00.
  585. // Indexes = 0x0000 - 0x0009.
  586. // Indexed 0x000A - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  587. // defined, Index = 0xFFFF indicates other.
  588. #define APP_INDEX_AO_TEMP_BOILER 0x00 // Boiler AO
  589. // AO Relative Humidity in % Indexes:
  590. // Type = 0x01.
  591. // Indexes = 0x0000 - 0x0001.
  592. // Indexed 0x0002 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  593. // defined, Index = 0xFFFF indicates other.
  594. #define APP_INDEX_AO_HUMIDITY_HUMIDIFICATION 0x00 // Humidification AO
  595. // AO Pressure in Pascal Indexes:
  596. // Type = 0x02.
  597. // Indexed 0x0000 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  598. // defined, Index = 0xFFFF indicates other.
  599. // AO Flow in liters/second Indexes:
  600. // Type = 0x03.
  601. // Indexed 0x0000 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  602. // defined, Index = 0xFFFF indicates other.
  603. // AO Percentage % Indexes:
  604. // Type = 0x04.
  605. // Indexes = 0x0000 - 0x002D.
  606. // Indexed 0x002E - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  607. // defined, Index = 0xFFFF indicates other.
  608. #define APP_INDEX_AO_PERCENT_FACE_BYPASS_DAMPER 0x00 // Face & Bypass Damper AO
  609. // AO Parts per Million PPM Indexes:
  610. // Type = 0x05.
  611. // Index = 0x0000.
  612. // Indexed 0x0001 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  613. // defined, Index = 0xFFFF indicates other.
  614. #define APP_INDEX_AO_PARTS_SPACE_CO2_LIMIT 0x00 // Space Carbon Dioxide limit AO
  615. // AO Rotational Speed in RPM Indexes:
  616. // Type = 0x06.
  617. // Indexes = 0x0000 - 0x0004.
  618. // Indexed 0x0005 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  619. // defined, Index = 0xFFFF indicates other.
  620. #define APP_INDEX_AO_ROTATION_EXHAUST_FAN_SPEED 0x00 // Exhaust Fan Speed AO
  621. // AO Current in Amps Indexes:
  622. // Type = 0x07.
  623. // Indexed 0x0000 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  624. // defined, Index = 0xFFFF indicates other.
  625. // AO Frequency in Hz Indexes:
  626. // Type = 0x08.
  627. // Indexed 0x0000 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  628. // defined, Index = 0xFFFF indicates other.
  629. // AO Power in Watts Indexes:
  630. // Type = 0x09.
  631. // Indexed 0x0000 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  632. // defined, Index = 0xFFFF indicates other.
  633. // AO Power in kW Indexes:
  634. // Type = 0x0A.
  635. // Indexed 0x0000 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  636. // defined, Index = 0xFFFF indicates other.
  637. // AO Energy in kWH Indexes:
  638. // Type = 0x0B.
  639. // Indexed 0x0000 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  640. // defined, Index = 0xFFFF indicates other.
  641. // AO Count - Unitless Indexes:
  642. // Type = 0x0C.
  643. // Indexed 0x0000 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  644. // defined, Index = 0xFFFF indicates other.
  645. // AO Enthalpy in KJoules/Kg Indexes:
  646. // Type = 0x0D.
  647. // Indexed 0x0000 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  648. // defined, Index = 0xFFFF indicates other.
  649. // AO Time in Seconds Indexes:
  650. // Type = 0x0E.
  651. // Index = 0x0000.
  652. // Indexed 0x0001 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  653. // defined, Index = 0xFFFF indicates other.
  654. #define APP_INDEX_AO_TIME_RELATIVE 0x00 // Relative time AO
  655. // Analog Value (AV) types
  656. // Group = 0x02.
  657. // AV Temperature in Degrees C Indexes:
  658. // Type = 0x00.
  659. // Indexes = 0x0000 - 0x000F.
  660. // Indexed 0x0010 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  661. // defined, Index = 0xFFFF indicates other.
  662. #define APP_INDEX_AV_TEMP_SETPOINT_OFFSET 0x00 // Setpoint Offset AV
  663. // AV Area in Square Metres Indexes:
  664. // Type = 0x01.
  665. // Index = 0x0000.
  666. // Indexed 0x0001 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  667. // defined, Index = 0xFFFF indicates other.
  668. #define APP_INDEX_AV_AREA_DUCT 0x00 // Duct Area AV
  669. // AV Multiplier - Number Indexes:
  670. // Type = 0x02.
  671. // Index = 0x0000.
  672. // Indexed 0x0001 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  673. // defined, Index = 0xFFFF indicates other.
  674. #define APP_INDEX_AV_MULTIPLIER_GAIN 0x00 // Gain multiplier AV
  675. // AV Flow in Litres/Second Indexes:
  676. // Type = 0x03.
  677. // Indexes = 0x0000 - 0x0005.
  678. // Indexed 0x0006 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  679. // defined, Index = 0xFFFF indicates other.
  680. #define APP_INDEX_AV_FLOW_MIN_AIR 0x00 // Minimum Air Flow AV
  681. // Binary Input (BI) types
  682. // Group = 0x03.
  683. // BI Application Domain HVAC Indexes:
  684. // Type = 0x00.
  685. // Indexes = 0x0000 - 0x0094.
  686. // Indexed 0x0095 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  687. // defined, Index = 0xFFFF indicates other.
  688. #define APP_INDEX_BI_DOMAIN_HVAC_2_PIPE_PUMP_STAT 0x00 // 2 Pipe Pump Status BI
  689. // BI Application Domain Security Indexes:
  690. // Type = 0x01.
  691. // Indexes = 0x0000 - 0x0008.
  692. // Indexed 0x0009 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  693. // defined, Index = 0xFFFF indicates other.
  694. #define APP_INDEX_BI_DOMAIN_SEC_GLASS_BREAK_DETECT 0x00 // Glass Breakage Detection
  695. // Binary Output (BO) types
  696. // Group = 0x04.
  697. // BO Application Domain HVAC Indexes:
  698. // Type = 0x00.
  699. // Indexes = 0x0000 - 0x0076.
  700. // Indexed 0x0078 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  701. // defined, Index = 0xFFFF indicates other.
  702. #define APP_INDEX_BO_DOMAIN_HVAC_2_PIPE_CIR_PUMP 0x00 // 2 Pipe Circulation Pump BO
  703. // BO Application Domain Security Indexes:
  704. // Type = 0x02.
  705. // Indexes = 0x0000 - 0x0003.
  706. // Indexed 0x0004 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  707. // defined, Index = 0xFFFF indicates other.
  708. #define APP_INDEX_BO_DOMAIN_SEC_ARM_DISARM_CMD 0x00 // Arm Disarm Command BO
  709. // Binary Value (BV) types
  710. // Group = 0x05.
  711. // BV Type Indexes:
  712. // Type = 0x00.
  713. // Indexed 0x0000 - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  714. // defined, Index = 0xFFFF indicates other.
  715. // Multistate Input (MI) types
  716. // Group = 0x0D.
  717. // MI Application Domain HVAC Indexes:
  718. // Type = 0x00.
  719. // Indexes = 0x0000 - 0x000B.
  720. // Indexed 0x000C - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  721. // defined, Index = 0xFFFF indicates other.
  722. #define APP_INDEX_MI_DOMAIN_HVAC_OFF_ON_AUTO 0x00 // Off, On, Auto
  723. // Multistate Output (MO)types
  724. // Group = 0x0E.
  725. // MO Application Domain HVAC Indexes:
  726. // Type = 0x00.
  727. // Indexes = 0x0000 - 0x000B.
  728. // Indexed 0x000C - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  729. // defined, Index = 0xFFFF indicates other.
  730. #define APP_INDEX_MO_DOMAIN_HVAC_OFF_ON_AUTO 0x00 // Off, On, Auto
  731. // Multistate Value (MV) types
  732. // Group = 0x13.
  733. // MV Application Domain HVAC Indexes:
  734. // Type = 0x00.
  735. // Indexes = 0x0000 - 0x000B.
  736. // Indexed 0x000C - 0x01FF are reserved, 0x0200 - 0xFFFE are Vendor
  737. // defined, Index = 0xFFFF indicates other.
  738. #define APP_INDEX_MV_DOMAIN_HVAC_OFF_ON_AUTO 0x00 // Off, On, Auto
  739. // The maximum number of characters to allow in a scene's name
  740. // remember that the first byte is the length
  741. #define ZCL_GEN_SCENE_NAME_LEN 16
  742. // The maximum length of the scene extension field:
  743. // 2 + 1 + 1 for On/Off cluster (onOff attibute)
  744. // 2 + 1 + 1 for Level Control cluster (currentLevel attribute)
  745. // 2 + 1 + 4 for Color Control cluster (currentX/currentY attributes)
  746. // 2 + 1 + 1 for Door Lock cluster (Lock State attribute)
  747. // 2 + 1 + 2 for Window Covering cluster (LiftPercentage/TiltPercentage attributes)
  748. #define ZCL_GEN_SCENE_EXT_LEN 24
  749. // The maximum number of entries in the Scene table
  750. #define ZCL_GEN_MAX_SCENES 16
  751. /*********************************************************************
  752. * TYPEDEFS
  753. */
  754. // The format of a Scene Table Entry
  755. typedef struct
  756. {
  757. uint16 groupID; // The group ID for which this scene applies
  758. uint8 ID; // Scene ID
  759. uint16 transTime; // Time to take to transition to this scene
  760. uint8 name[ZCL_GEN_SCENE_NAME_LEN]; // Scene name
  761. uint8 extLen; // Length of extension fields
  762. uint8 extField[ZCL_GEN_SCENE_EXT_LEN]; // Extension fields
  763. } zclGeneral_Scene_t;
  764. // The format of an Alarm Table entry
  765. typedef struct
  766. {
  767. uint8 code; // Identifying code for the cause of the alarm
  768. uint16 clusterID; // The id of the cluster whose attribute generated this alarm
  769. uint32 timeStamp; // The time at which the alarm occured
  770. } zclGeneral_Alarm_t;
  771. // The format of the Get Event Log Command
  772. typedef struct
  773. {
  774. uint8 logID; // Log to be queried
  775. uint32 startTime; // Start time of events
  776. uint32 endTime; // End time of events
  777. uint8 numEvents; // Max number of events requested
  778. } zclGetEventLog_t;
  779. // The format of the Publish Event Log Command Sub Log Payload
  780. typedef struct
  781. {
  782. uint8 eventId; // event ID (i.e., associated event configuration attribute ID)
  783. uint32 eventTime; // UTC time event occured
  784. } zclEventLogPayload_t;
  785. // The format of the Publish Event Log Command
  786. typedef struct
  787. {
  788. uint8 logID; // Log to be queried
  789. uint8 cmdIndex; // Command index to count payload fragments
  790. uint8 totalCmds; // Total number of responses expected
  791. uint8 numSubLogs; // Number of sub log payloads
  792. zclEventLogPayload_t *pLogs; // Sub log payloads (series of events)
  793. } zclPublishEventLog_t;
  794. /*** RSSI Location Cluster Data Types ***/
  795. // Set Absolute Location Command format
  796. typedef struct
  797. {
  798. int16 coordinate1;
  799. int16 coordinate2;
  800. int16 coordinate3;
  801. int16 power;
  802. uint16 pathLossExponent;
  803. } zclLocationAbsolute_t;
  804. // Set Device Configuration Command format
  805. typedef struct
  806. {
  807. int16 power;
  808. uint16 pathLossExponent;
  809. uint16 calcPeriod;
  810. uint8 numMeasurements;
  811. uint16 reportPeriod;
  812. } zclLocationDevCfg_t;
  813. // Get Location Data Command format
  814. typedef struct
  815. {
  816. unsigned int absOnly:1; // Absolute Only
  817. unsigned int recalc:1; // Re-calculate
  818. unsigned int brdcastIndic:1; // Broadcast Indicator
  819. unsigned int brdcastRsp:1; // Broadcast Response
  820. unsigned int compactRsp:1; // Compact Response
  821. unsigned int reserved:3; // Reserved for future use
  822. } locationbits_t;
  823. typedef union
  824. {
  825. locationbits_t locBits;
  826. uint8 locByte;
  827. } location_t;
  828. typedef struct
  829. {
  830. location_t bitmap;
  831. uint8 numResponses;
  832. uint8 targetAddr[8];
  833. // shorthand access
  834. #define absoluteOnly bitmap.locBits.absOnly
  835. #define recalculate bitmap.locBits.recalc
  836. #define brdcastIndicator bitmap.locBits.brdcastIndic
  837. #define brdcastResponse bitmap.locBits.brdcastRsp
  838. #define compactResponse bitmap.locBits.compactRsp
  839. } zclLocationGetData_t;
  840. // Device Configuration Response Command format
  841. typedef struct
  842. {
  843. uint8 status;
  844. zclLocationDevCfg_t data;
  845. } zclLocationDevCfgRsp_t;
  846. // Calculated Location Data type
  847. typedef struct
  848. {
  849. uint8 locationMethod;
  850. uint8 qualityMeasure;
  851. uint16 locationAge;
  852. } zclLocationCalculated_t;
  853. // Location Data Type
  854. typedef struct
  855. {
  856. uint8 type;
  857. zclLocationAbsolute_t absLoc;
  858. zclLocationCalculated_t calcLoc;
  859. } zclLocationData_t;
  860. // Location Data Response Command format
  861. typedef struct
  862. {
  863. uint8 status;
  864. zclLocationData_t data;
  865. } zclLocationDataRsp_t;
  866. /*** Structures used for callback functions ***/
  867. typedef struct
  868. {
  869. afAddrType_t *srcAddr; // requestor's address
  870. uint16 identifyTime; // number of seconds the device will continue to identify itself
  871. } zclIdentify_t;
  872. typedef struct
  873. {
  874. afAddrType_t *srcAddr; // requestor's address
  875. uint16 timeout; // number of seconds the device will continue to identify itself
  876. } zclIdentifyQueryRsp_t;
  877. typedef struct
  878. {
  879. uint8 level; // new level to move to
  880. uint16 transitionTime; // time to take to move to the new level (in seconds)
  881. uint8 withOnOff; // with On/off command
  882. } zclLCMoveToLevel_t;
  883. typedef struct
  884. {
  885. uint8 moveMode; // move mode which is either LEVEL_MOVE_STOP, LEVEL_MOVE_UP,
  886. // LEVEL_MOVE_ON_AND_UP, LEVEL_MOVE_DOWN, or LEVEL_MOVE_DOWN_AND_OFF
  887. uint8 rate; // rate of movement in steps per second
  888. uint8 withOnOff; // with On/off command
  889. } zclLCMove_t;
  890. typedef struct
  891. {
  892. uint8 stepMode; // step mode which is either LEVEL_STEP_UP, LEVEL_STEP_ON_AND_UP,
  893. // LEVEL_STEP_DOWN, or LEVEL_STEP_DOWN_AND_OFF
  894. uint8 amount; // number of levels to step
  895. uint16 transitionTime; // time, in 1/10ths of a second, to take to perform the step
  896. uint8 withOnOff; // with On/off command
  897. } zclLCStep_t;
  898. typedef struct
  899. {
  900. afAddrType_t *srcAddr; // requestor's address
  901. uint8 cmdID; // which group message - COMMAND_GROUP_ADD_RSP, COMMAND_GROUP_VIEW_RSP,
  902. // COMMAND_GROUP_REMOVE_RSP or COMMAND_GROUP_GET_MEMBERSHIP_RSP
  903. uint8 status; // GROUP_STATUS_SUCCESS, GROUP_STATUS_TABLE_FULL,
  904. // GROUP_STATUS_ALREADY_IN_TABLE, or GROUP_STATUS_NOT_IN_TABLE. Not
  905. // valid for COMMAND_GROUP_GET_MEMBERSHIP_RSP
  906. uint8 grpCnt; // number of groups contained in group list
  907. uint16 *grpList; // what group IDs the action was performed on
  908. uint8 capacity; // remaining capacity of group table
  909. uint8 *grpName; // only valid for COMMAND_GROUP_VIEW_RSP
  910. } zclGroupRsp_t;
  911. typedef struct
  912. {
  913. afAddrType_t *srcAddr; // requestor's address
  914. zclGeneral_Scene_t *scene; // pointer to the scene structure
  915. } zclSceneReq_t;
  916. typedef struct
  917. {
  918. afAddrType_t *srcAddr; // requestor's address
  919. uint8 cmdID; // which response - COMMAND_SCENE_ADD_RSP, COMMAND_SCENE_VIEW_RSP,
  920. // COMMAND_SCENE_REMOVE_RSP, COMMAND_SCENE_REMOVE_ALL_RSP,
  921. // COMMAND_SCENE_STORE_RSP or COMMAND_SCENE_GET_MEMBERSHIPSHIP_RSP
  922. uint8 status; // response status
  923. uint8 sceneCnt; // number of scenes in the scene list (only valid for
  924. // COMMAND_SCENE_GET_MEMBERSHIPSHIP_RSP)
  925. uint8 *sceneList; // list of scene IDs (only valid for COMMAND_SCENE_GET_MEMBERSHIPSHIP_RSP)
  926. uint8 capacity; // remaining capacity of the scene table (only valid for
  927. // COMMAND_SCENE_GET_MEMBERSHIPSHIP_RSP)
  928. zclGeneral_Scene_t *scene; // pointer to the scene structure
  929. } zclSceneRsp_t;
  930. typedef struct
  931. {
  932. afAddrType_t *srcAddr; // requestor's address
  933. uint8 cmdID; // COMMAND_ALARMS_ALARM or COMMAND_ALARMS_GET_RSP
  934. uint8 status; // response status (only applicable to COMMAND_ALARMS_GET_RSP)
  935. uint8 alarmCode; // response status (only applicable to COMMAND_ALARMS_GET_RSP)
  936. uint16 clusterID; // the id of the cluster whose attribute generated this alarm
  937. uint32 timeStamp; // the time at which the alarm occurred (only applicable to
  938. // COMMAND_ALARMS_GET_RSP)
  939. } zclAlarm_t;
  940. typedef struct
  941. {
  942. afAddrType_t *srcAddr; // requestor's address
  943. uint8 cmdID; // COMMAND_LOCATION_SET_ABSOLUTE, COMMAND_LOCATION_SET_DEV_CFG,
  944. // COMMAND_LOCATION_GET_DEV_CFG or COMMAND_LOCATION_GET_DATA
  945. union
  946. {
  947. zclLocationAbsolute_t absLoc; // Absolute Location info (only valid for COMMAND_LOCATION_SET_ABSOLUTE)
  948. zclLocationGetData_t loc; // Get Location info (only valid for COMMAND_LOCATION_GET_DATA)
  949. zclLocationDevCfg_t devCfg; // Device Config info (only valid for COMMAND_LOCATION_SET_DEV_CFG)
  950. uint8 *ieeeAddr; // Device's IEEE Addr (only valid for COMMAND_LOCATION_GET_DEV_CFG)
  951. } un;
  952. uint8 seqNum; // Sequence number received with the message (only valid for GET commands)
  953. } zclLocation_t;
  954. typedef struct
  955. {
  956. afAddrType_t *srcAddr; // requestor's address
  957. uint8 cmdID; // COMMAND_LOCATION_DEV_CFG_RSP, COMMAND_LOCATION_DATA_RSP,
  958. // COMMAND_LOCATION_DATA_NOTIF, COMMAND_LOCATION_COMPACT_DATA_NOTIF
  959. // or COMMAND_LOCATION_RSSI_PING
  960. union
  961. {
  962. zclLocationDataRsp_t loc; // the Location Data Response command (applicable to Data Response/Notification)
  963. zclLocationDevCfgRsp_t devCfg; // the Device Configuration Response command (only applicable to
  964. // COMMAND_LOCATION_DEV_CFG_RSP)
  965. uint8 locationType; // location type (only applicable to COMMAND_LOCATION_RSSI_PING)
  966. } un;
  967. } zclLocationRsp_t;
  968. // This callback is called to process an incoming Reset to Factory Defaults
  969. // command. On receipt of this command, the device resets all the attributes
  970. // of all its clusters to their factory defaults.
  971. typedef void (*zclGCB_BasicReset_t)( void );
  972. // This callback is called to process an incoming Identify command.
  973. // srcAddr - requestor's address
  974. // identifyTime - number of seconds the device will continue to identify itself
  975. typedef void (*zclGCB_Identify_t)( zclIdentify_t *pCmd );
  976. // This callback is called to process an incoming Identify Query Response command.
  977. // srcAddr - requestor's address
  978. // timeout - number of seconds the device will continue to identify itself
  979. typedef void (*zclGCB_IdentifyQueryRsp_t)( zclIdentifyQueryRsp_t *pRsp );
  980. // This callback is called to process an incoming On, Off or Toggle command.
  981. // cmd - received command, which will be either COMMAND_ON, COMMAND_OFF
  982. // or COMMAND_TOGGLE.
  983. typedef void (*zclGCB_OnOff_t)( uint8 cmd );
  984. // This callback is called to process a Level Control - Move to Level command
  985. // level - new level to move to
  986. // tansitionTime - time to take to move to the new level (in seconds)
  987. // withOnOff - with On/off command
  988. typedef void (*zclGCB_LevelControlMoveToLevel_t)( zclLCMoveToLevel_t *pCmd );
  989. // This callback is called to process a Level Control - Move command
  990. // moveMode - move mode which is either LEVEL_MOVE_STOP, LEVEL_MOVE_UP,
  991. // LEVEL_MOVE_ON_AND_UP, LEVEL_MOVE_DOWN, or LEVEL_MOVE_DOWN_AND_OFF
  992. // rate - rate of movement in steps per second.
  993. // withOnOff - with On/off command
  994. typedef void (*zclGCB_LevelControlMove_t)( zclLCMove_t *pCmd );
  995. // This callback is called to process a Level Control - Step command
  996. // stepMode - step mode which is either LEVEL_STEP_UP, LEVEL_STEP_ON_AND_UP,
  997. // LEVEL_STEP_DOWN, or LEVEL_STEP_DOWN_AND_OFF
  998. // amount - number of levels to step
  999. // transitionTime - time, in 1/10ths of a second, to take to perform the step
  1000. // withOnOff - with On/off command
  1001. typedef void (*zclGCB_LevelControlStep_t)( zclLCStep_t *pCmd );
  1002. // This callback is called to process a Level Control - Stop command
  1003. typedef void (*zclGCB_LevelControlStop_t)( void );
  1004. // This callback is called to process an received Group Response message.
  1005. // This means that this app sent the request message.
  1006. // srcAddr - requestor's address
  1007. // cmdID - which group message - COMMAND_GROUP_ADD_RSP, COMMAND_GROUP_VIEW_RSP,
  1008. // COMMAND_GROUP_REMOVE_RSP or COMMAND_GROUP_GET_MEMBERSHIP_RSP
  1009. // status - GROUP_STATUS_SUCCESS, GROUP_STATUS_TABLE_FULL,
  1010. // GROUP_STATUS_ALREADY_IN_TABLE, or GROUP_STATUS_NOT_IN_TABLE. Not
  1011. // valid for COMMAND_GROUP_GET_MEMBERSHIP_RSP
  1012. // grpCnt - number of groups contained in group list
  1013. // grpList - what group IDs the action was performed on
  1014. // capacity - remaining capacity of group table
  1015. // grpName - only valid for COMMAND_GROUP_VIEW_RSP
  1016. typedef void (*zclGCB_GroupRsp_t)( zclGroupRsp_t *pRsp );
  1017. // This callback is called to process an incoming Scene Store request.
  1018. // The app will fill in the "extField" with what is needed to restore its
  1019. // current settings.
  1020. // srcAddr - requestor's address
  1021. // scene - pointer to the scene structure
  1022. // returns TRUE if extField is filled in, FALSE if not used.
  1023. typedef uint8 (*zclGCB_SceneStoreReq_t)( zclSceneReq_t *pReq );
  1024. // This callback is called to process an incoming Scene Recall request
  1025. // The app will use what's in the "extField" to restore to these settings.
  1026. // srcAddr - requestor's address
  1027. // scene - pointer to the scene structure
  1028. typedef void (*zclGCB_SceneRecallReq_t)( zclSceneReq_t *pReq );
  1029. // This callback is called to process an incoming Scene responses. This means
  1030. // that this app sent the request for this response.
  1031. // srcAddr - requestor's address
  1032. // cmdID - which response - COMMAND_SCENE_ADD_RSP, COMMAND_SCENE_VIEW_RSP,
  1033. // COMMAND_SCENE_REMOVE_RSP, COMMAND_SCENE_REMOVE_ALL_RSP,
  1034. // COMMAND_SCENE_STORE_RSP or COMMAND_SCENE_GET_MEMBERSHIPSHIP_RSP
  1035. // status - response status
  1036. // sceneCnt - number of scenes in the scene list (only valid for
  1037. // COMMAND_SCENE_GET_MEMBERSHIPSHIP_RSP)
  1038. // sceneList - list of scene IDs (only valid for COMMAND_SCENE_GET_MEMBERSHIPSHIP_RSP)
  1039. // capacity - remaining capacity of the scene table (only valid for
  1040. // COMMAND_SCENE_GET_MEMBERSHIPSHIP_RSP)
  1041. // scene - pointer to the scene structure
  1042. typedef void (*zclGCB_SceneRsp_t)( zclSceneRsp_t *pRsp );
  1043. // This callback is called to process an incoming Alarm request or response command.
  1044. // srcAddr - requestor's address
  1045. // cmdID - COMMAND_ALARMS_ALARM or COMMAND_ALARMS_GET_RSP
  1046. // status - response status (only applicable to COMMAND_ALARMS_GET_RSP)
  1047. // alarmCode - identifying code for the cause of the alarm
  1048. // clusterID - the id of the cluster whose attribute generated this alarm
  1049. // timeStamp - the time at which the alarm occurred (only applicable to
  1050. // COMMAND_ALARMS_GET_RSP)
  1051. typedef void (*zclGCB_Alarm_t)( zclAlarm_t *pAlarm );
  1052. // This callback is called to process an incoming Alarm Get Event Log command.
  1053. // srcAddr - requestor's address
  1054. // pEventLog - pointer to Get Event Log Command
  1055. typedef void (*zclGCB_GetEventLog_t)( uint8 srcEP, afAddrType_t *srcAddr,
  1056. zclGetEventLog_t *pEventLog, uint8 seqNum );
  1057. // This callback is called to process an incoming Alarm Publish Event Log command.
  1058. // srcAddr - responder's address
  1059. // pEventLog - pointer to Publish Event Log Command
  1060. typedef void (*zclGCB_PublishEventLog_t)( afAddrType_t *srcAddr, zclPublishEventLog_t *pEventLog );
  1061. // This callback is called to to process an incoming RSSI Location command.
  1062. // srcAddr - requestor's address
  1063. // cmdID - COMMAND_LOCATION_SET_ABSOLUTE, COMMAND_LOCATION_SET_DEV_CFG,
  1064. // COMMAND_LOCATION_GET_DEV_CFG or COMMAND_LOCATION_GET_DATA
  1065. // absLoc - Absolute Location info (only valid for COMMAND_LOCATION_SET_ABSOLUTE)
  1066. // loc - Get Location info (only valid for COMMAND_LOCATION_GET_DATA)
  1067. // devCfg - Device Config info (only valid for COMMAND_LOCATION_SET_DEV_CFG)
  1068. // ieeeAddr - Device's IEEE Addr (only valid for COMMAND_LOCATION_GET_DEV_CFG)
  1069. // seqNum - Sequence number received with the message (only valid for GET commands)
  1070. typedef void (*zclGCB_Location_t)( zclLocation_t *pCmd );
  1071. // This callback is called to process an incoming RSSI Location response command.
  1072. // This means that this app sent the request for this response.
  1073. // srcAddr - requestor's address
  1074. // cmdID - COMMAND_LOCATION_DEV_CFG_RSP, COMMAND_LOCATION_DATA_RSP,
  1075. // COMMAND_LOCATION_DATA_NOTIF, COMMAND_LOCATION_COMPACT_DATA_NOTIF
  1076. // or COMMAND_LOCATION_RSSI_PING
  1077. // locRsp - the Location Data Response command (applicable to Data Response/Notification)
  1078. // devCfgRsp - the Device Configuration Response command (only applicable to
  1079. // COMMAND_LOCATION_DEV_CFG_RSP)
  1080. // locationType - location type (only applicable to COMMAND_LOCATION_RSSI_PING)
  1081. typedef void (*zclGCB_LocationRsp_t)( zclLocationRsp_t *pRsp );
  1082. // Register Callbacks table entry - enter function pointers for callbacks that
  1083. // the application would like to receive
  1084. typedef struct
  1085. {
  1086. zclGCB_BasicReset_t pfnBasicReset; // Basic Cluster Reset command
  1087. zclGCB_Identify_t pfnIdentify; // Identify command
  1088. zclGCB_IdentifyQueryRsp_t pfnIdentifyQueryRsp; // Identify Query Response command
  1089. zclGCB_OnOff_t pfnOnOff; // On/Off cluster commands
  1090. zclGCB_LevelControlMoveToLevel_t pfnLevelControlMoveToLevel; // Level Control Move to Level command
  1091. zclGCB_LevelControlMove_t pfnLevelControlMove; // Level Control Move command
  1092. zclGCB_LevelControlStep_t pfnLevelControlStep; // Level Control Step command
  1093. zclGCB_LevelControlStop_t pfnLevelControlStop; // Level Control Stop command
  1094. zclGCB_GroupRsp_t pfnGroupRsp; // Group Response commands
  1095. zclGCB_SceneStoreReq_t pfnSceneStoreReq; // Scene Store Request command
  1096. zclGCB_SceneRecallReq_t pfnSceneRecallReq; // Scene Recall Request command
  1097. zclGCB_SceneRsp_t pfnSceneRsp; // Scene Response command
  1098. zclGCB_Alarm_t pfnAlarm; // Alarm (Response) commands
  1099. #ifdef SE_UK_EXT
  1100. zclGCB_GetEventLog_t pfnGetEventLog; // Get Event Log command
  1101. zclGCB_PublishEventLog_t pfnPublishEventLog; // Publish Event Log command
  1102. #endif
  1103. zclGCB_Location_t pfnLocation; // RSSI Location command
  1104. zclGCB_LocationRsp_t pfnLocationRsp; // RSSI Location Response command
  1105. } zclGeneral_AppCallbacks_t;
  1106. /*********************************************************************
  1107. * FUNCTION MACROS
  1108. */
  1109. #ifdef ZCL_BASIC
  1110. /*
  1111. * Send a Reset to Factory Defaults Command - COMMAND_BASIC_RESET_FACTORY_DEFAULTS
  1112. * Use like:
  1113. * ZStatus_t zclGeneral_SendBasicResetFactoryDefaults( uint16 srcEP, afAddrType_t *dstAddr, uint8 disableDefaultRsp, uint8 seqNum );
  1114. */
  1115. #define zclGeneral_SendBasicResetFactoryDefaults(a,b,c,d) zcl_SendCommand( (a), (b), ZCL_CLUSTER_ID_GEN_BASIC, COMMAND_BASIC_RESET_FACT_DEFAULT, TRUE, ZCL_FRAME_CLIENT_SERVER_DIR, (c), 0, (d), 0, NULL )
  1116. #endif // ZCL_BASIC
  1117. #ifdef ZCL_IDENTIFY
  1118. /*
  1119. * Send a Identify Query command
  1120. * Use like:
  1121. * ZStatus_t zclGeneral_SendIdentifyQuery( uint8 srcEP, afAddrType_t *dstAddr, uint8 disableDefaultRsp, uint8 seqNum );
  1122. */
  1123. #define zclGeneral_SendIdentifyQuery(a,b,c,d) zcl_SendCommand( (a), (b), ZCL_CLUSTER_ID_GEN_IDENTIFY, COMMAND_IDENTIFY_QUERY, TRUE, ZCL_FRAME_CLIENT_SERVER_DIR, (c), 0, (d), 0, NULL )
  1124. #endif // ZCL_IDENTIFY
  1125. #ifdef ZCL_GROUPS
  1126. /*
  1127. * Send a Group Add Command
  1128. * Use like:
  1129. * ZStatus_t zclGeneral_SendGroupAdd( uint8 srcEP, afAddrType_t *dstAddr, uint16 groupID, uint8 *groupName, uint8 disableDefaultRsp, uint8 seqNum );
  1130. */
  1131. #define zclGeneral_SendGroupAdd(a,b,c,d,e,f) zclGeneral_SendAddGroupRequest( (a), (b), COMMAND_GROUP_ADD, (c), (d), (e), (f) )
  1132. /*
  1133. * Send a Group View Command
  1134. * Use like:
  1135. * ZStatus_t zclGeneral_SendGroupView( uint8 srcEP, afAddrType_t *dstAddr, uint16 groupID, uint8 disableDefaultRsp, uint8 seqNum );
  1136. */
  1137. #define zclGeneral_SendGroupView(a,b,c,d,e) zclGeneral_SendGroupRequest( (a), (b), COMMAND_GROUP_VIEW, (c), (d), (e) )
  1138. /*
  1139. * Send a Group Get Membership Command
  1140. * Use like:
  1141. * ZStatus_t zclGeneral_SendGroupGetMembership( uint8 srcEP, afAddrType_t *dstAddr, uint8 grpCnt, uint16 *grpList, uint8 disableDefaultRsp, uint8 seqNum );
  1142. */
  1143. #define zclGeneral_SendGroupGetMembership(a,b,c,d,e,f) zclGeneral_SendGroupGetMembershipRequest( (a), (b), COMMAND_GROUP_GET_MEMBERSHIP, FALSE, ZCL_FRAME_CLIENT_SERVER_DIR, 0, (c), (d), (e), (f) )
  1144. /*
  1145. * Send a Group Remove Command
  1146. * Use like:
  1147. * ZStatus_t zclGeneral_SendGroupRemove( uint8 srcEP, afAddrType_t *dstAddr, uint16 groupID, uint8 disableDefaultRsp, uint8 seqNum );
  1148. */
  1149. #define zclGeneral_SendGroupRemove(a,b,c,d,e) zclGeneral_SendGroupRequest( (a), (b), COMMAND_GROUP_REMOVE, (c), (d), (e) )
  1150. /*
  1151. * Send a Group Remove ALL Command - COMMAND_GROUP_REMOVE_ALL
  1152. * Use like:
  1153. * ZStatus_t zclGeneral_SendGroupRemoveAll( uint16 srcEP, afAddrType_t *dstAddr, uint8 disableDefaultRsp, uint8 seqNum );
  1154. */
  1155. #define zclGeneral_SendGroupRemoveAll(a,b,c,d) zcl_SendCommand( (a), (b), ZCL_CLUSTER_ID_GEN_GROUPS, COMMAND_GROUP_REMOVE_ALL, TRUE, ZCL_FRAME_CLIENT_SERVER_DIR, (c), 0, (d), 0, NULL )
  1156. /*
  1157. * Send a Group Add If Identifying Command
  1158. * Use like:
  1159. * ZStatus_t zclGeneral_SendGroupAddIfIdentifying( uint8 srcEP, afAddrType_t *dstAddr, uint16 groupID, uint8 *groupName, uint8 disableDefaultRsp, uint8 seqNum );
  1160. */
  1161. #define zclGeneral_SendGroupAddIfIdentifying(a,b,c,d,e,f) zclGeneral_SendAddGroupRequest( (a), (b), COMMAND_GROUP_ADD_IF_IDENTIFYING, (c), (d), (e), (f) )
  1162. /*
  1163. * Send a Group Add Response Command
  1164. * Use like:
  1165. * ZStatus_t zclGeneral_SendGroupAddResponse( uint8 srcEP, afAddrType_t *dstAddr, uint8 status, uint16 groupID, uint8 disableDefaultRsp, uint8 seqNum );
  1166. */
  1167. #define zclGeneral_SendGroupAddResponse(a,b,c,d,e,f) zclGeneral_SendGroupResponse( (a), (b), COMMAND_GROUP_ADD_RSP, (c), (d), (e), (f) )
  1168. /*
  1169. * Send a Group Get Membership Response Command
  1170. * Use like:
  1171. * ZStatus_t zclGeneral_SendGroupGetMembershipResponse( uint8 srcEP, afAddrType_t *dstAddr, uint8 capacity, uint8 grpCnt, uint16 *grpList, uint8 disableDefaultRsp, uint8 seqNum );
  1172. */
  1173. #define zclGeneral_SendGroupGetMembershipResponse(a,b,c,d,e,f,g) zclGeneral_SendGroupGetMembershipRequest( (a), (b), COMMAND_GROUP_GET_MEMBERSHIP_RSP, TRUE, ZCL_FRAME_SERVER_CLIENT_DIR, (c), (d), (e), (f), (g) )
  1174. /*
  1175. * Send a Group Remove Response Command
  1176. * Use like:
  1177. * ZStatus_t zclGeneral_SendGroupRemoveResponse( uint8 srcEP, afAddrType_t *dstAddr, uint8 status, uint16 groupID, uint8 disableDefaultRsp, uint8 seqNum );
  1178. */
  1179. #define zclGeneral_SendGroupRemoveResponse(a,b,c,d,e,f) zclGeneral_SendGroupResponse( (a), (b), COMMAND_GROUP_REMOVE_RSP, (c), (d), (e), (f) )
  1180. #endif // ZCL_GROUPS
  1181. #ifdef ZCL_SCENES
  1182. /*
  1183. * Send a Scene View Command
  1184. * Use like:
  1185. * ZStatus_t zclGeneral_SendSceneView( uint8 srcEP, afAddrType_t *dstAddr, uint16 groupID, uint8 sceneID, uint8 disableDefaultRsp, uint8 seqNum );
  1186. */
  1187. #define zclGeneral_SendSceneView(a,b,c,d,e,f) zclGeneral_SendSceneRequest( (a), (b), COMMAND_SCENE_VIEW, (c), (d), (e), (f) )
  1188. /*
  1189. * Send a Scene Remove Command
  1190. * Use like:
  1191. * ZStatus_t zclGeneral_SendSceneRemove( uint8 srcEP, afAddrType_t *dstAddr, uint16 groupID, uint8 sceneID, uint8 disableDefaultRsp, uint8 seqNum );
  1192. */
  1193. #define zclGeneral_SendSceneRemove(a,b,c,d,e,f) zclGeneral_SendSceneRequest( (a), (b), COMMAND_SCENE_REMOVE, (c), (d), (e), (f) )
  1194. /*
  1195. * Send a Scene Store Command
  1196. * Use like:
  1197. * ZStatus_t zclGeneral_SendSceneStore( uint8 srcEP, afAddrType_t *dstAddr, uint16 groupID, uint8 sceneID, uint8 disableDefaultRsp, uint8 seqNum );
  1198. */
  1199. #define zclGeneral_SendSceneStore(a,b,c,d,e,f) zclGeneral_SendSceneRequest( (a), (b), COMMAND_SCENE_STORE, (c), (d), (e), (f) )
  1200. /*
  1201. * Send a Scene Recall Command
  1202. * Use like:
  1203. * ZStatus_t zclGeneral_SendSceneRecall( uint8 srcEP, afAddrType_t *dstAddr, uint16 groupID, uint8 sceneID, uint8 disableDefaultRsp, uint8 seqNum );
  1204. */
  1205. #define zclGeneral_SendSceneRecall(a,b,c,d,e,f) zclGeneral_SendSceneRequest( (a), (b), COMMAND_SCENE_RECALL, (c), (d), (e), (f) )
  1206. /*
  1207. * Send a Scene Remove ALL Command - COMMAND_SCENE_REMOVE_ALL
  1208. * Use like:
  1209. * ZStatus_t zclGeneral_SendSceneRemoveAll( uint16 srcEP, afAddrType_t *dstAddr, uint16 groupID, uint8 disableDefaultRsp, uint8 seqNum );
  1210. */
  1211. #define zclGeneral_SendSceneRemoveAll(a,b,c,d,e) zclGeneral_SendSceneRequest( (a), (b), COMMAND_SCENE_REMOVE_ALL, (c), 0, (d), (e) )
  1212. /*
  1213. * Send a Scene Get Membership Command - COMMAND_SCENE_GET_MEMBERSHIPSHIP
  1214. * Use like:
  1215. * ZStatus_t zclGeneral_SendSceneGetMembership( uint16 srcEP, afAddrType_t *dstAddr, uint16 groupID, uint8 disableDefaultRsp, uint8 seqNum );
  1216. */
  1217. #define zclGeneral_SendSceneGetMembership(a,b,c,d,e) zclGeneral_SendSceneRequest( (a), (b), COMMAND_SCENE_GET_MEMBERSHIP, (c), 0, (d), (e) )
  1218. /*
  1219. * Send a Scene Remove ALL Response Command - COMMAND_SCENE_ADD_RSP
  1220. * Use like:
  1221. * ZStatus_t zclGeneral_SendSceneAddResponse( uint16 srcEP, afAddrType_t *dstAddr, uint8 status, uint16 groupID, uint8 sceneID, uint8 disableDefaultRsp, uint8 seqNum );
  1222. */
  1223. #define zclGeneral_SendSceneAddResponse(a,b,c,d,e,f,g) zclGeneral_SendSceneResponse( (a), (b), COMMAND_SCENE_ADD_RSP, (c), (d), (e), (f), (g) )
  1224. /*
  1225. * Send a Scene Remove Response Command - COMMAND_SCENE_REMOVE_RSP
  1226. * Use like:
  1227. * ZStatus_t zclGeneral_SendSceneRemoveResponse( uint16 srcEP, afAddrType_t *dstAddr, uint8 status, uint16 groupID, uint8 sceneID, uint8 disableDefaultRsp, uint8 seqNum );
  1228. */
  1229. #define zclGeneral_SendSceneRemoveResponse(a,b,c,d,e,f,g) zclGeneral_SendSceneResponse( (a), (b), COMMAND_SCENE_REMOVE_RSP, (c), (d), (e), (f), (g) )
  1230. /*
  1231. * Send a Scene Remove All Response Command - COMMAND_SCENE_REMOVE_ALL_RSP
  1232. * Use like:
  1233. * ZStatus_t zclGeneral_SendSceneRemoveAllResponse( uint16 srcEP, afAddrType_t *dstAddr, uint8 status, uint16 groupID, uint8 disableDefaultRsp, uint8 seqNum );
  1234. */
  1235. #define zclGeneral_SendSceneRemoveAllResponse(a,b,c,d,e,f) zclGeneral_SendSceneResponse( (a), (b), COMMAND_SCENE_REMOVE_ALL_RSP, (c), (d), 0, (e), (f) )
  1236. /*
  1237. * Send a Scene Remove ALL Response Command - COMMAND_SCENE_STORE_RSP
  1238. * Use like:
  1239. * ZStatus_t zclGeneral_SendSceneStoreResponse( uint16 srcEP, afAddrType_t *dstAddr, uint8 status, uint16 groupID, uint8 sceneID, uint8 disableDefaultRsp, uint8 seqNum );
  1240. */
  1241. #define zclGeneral_SendSceneStoreResponse(a,b,c,d,e,f,g) zclGeneral_SendSceneResponse( (a), (b), COMMAND_SCENE_STORE_RSP, (c), (d), (e), (f), (g) )
  1242. #endif // ZCL_SCENES
  1243. #ifdef ZCL_ON_OFF
  1244. /*
  1245. * Send an On Off Command - COMMAND_ONOFF_OFF
  1246. * Use like:
  1247. * ZStatus_t zclGeneral_SendOnOff_CmdOff( uint16 srcEP, afAddrType_t *dstAddr, uint8 disableDefaultRsp, uint8 seqNum );
  1248. */
  1249. #define zclGeneral_SendOnOff_CmdOff(a,b,c,d) zcl_SendCommand( (a), (b), ZCL_CLUSTER_ID_GEN_ON_OFF, COMMAND_OFF, TRUE, ZCL_FRAME_CLIENT_SERVER_DIR, (c), 0, (d), 0, NULL )
  1250. /*
  1251. * Send an On Off Command - COMMAND_ONOFF_ON
  1252. * Use like:
  1253. * ZStatus_t zclGeneral_SendOnOff_CmdOn( uint16 srcEP, afAddrType_t *dstAddr, uint8 disableDefaultRsp, uint8 seqNum );
  1254. */
  1255. #define zclGeneral_SendOnOff_CmdOn(a,b,c,d) zcl_SendCommand( (a), (b), ZCL_CLUSTER_ID_GEN_ON_OFF, COMMAND_ON, TRUE, ZCL_FRAME_CLIENT_SERVER_DIR, (c), 0, (d), 0, NULL )
  1256. /*
  1257. * Send an On Off Command - COMMAND_ONOFF_TOGGLE
  1258. * Use like:
  1259. * ZStatus_t zclGeneral_SendOnOff_CmdToggle( uint16 srcEP, afAddrType_t *dstAddr, uint8 disableDefaultRsp, uint8 seqNum );
  1260. */
  1261. #define zclGeneral_SendOnOff_CmdToggle(a,b,c,d) zcl_SendCommand( (a), (b), ZCL_CLUSTER_ID_GEN_ON_OFF, COMMAND_TOGGLE, TRUE, ZCL_FRAME_CLIENT_SERVER_DIR, (c), 0, (d), 0, NULL )
  1262. #endif // ZCL_ON_OFF
  1263. #ifdef ZCL_LEVEL_CTRL
  1264. /*
  1265. * Send a Level Control Move to Level Command - COMMAND_LEVEL_MOVE_TO_LEVEL
  1266. * Use like:
  1267. * ZStatus_t zclGeneral_SendLevelControlMoveToLevel( uint16 srcEP, afAddrType_t *dstAddr, uint8 level, uint16 transTime, uint8 disableDefaultRsp, uint8 seqNum );
  1268. */
  1269. #define zclGeneral_SendLevelControlMoveToLevel(a,b,c,d,e,f) zclGeneral_SendLevelControlMoveToLevelRequest( (a), (b), COMMAND_LEVEL_MOVE_TO_LEVEL, (c), (d), (e) ,(f) )
  1270. /*
  1271. * Send a Level Control Move Command - COMMAND_LEVEL_MOVE
  1272. * Use like:
  1273. * ZStatus_t zclGeneral_SendLevelControlMoveRequest( uint8 srcEP, afAddrType_t *dstAddr, uint8 moveMode, uint8 rate, uint8 disableDefaultRsp, uint8 seqNum )
  1274. */
  1275. #define zclGeneral_SendLevelControlMove(a,b,c,d,e,f) zclGeneral_SendLevelControlMoveRequest( (a), (b), COMMAND_LEVEL_MOVE, (c), (d), (e), (f) )
  1276. /*
  1277. * Send out a Level Control Step Command - COMMAND_LEVEL_STEP
  1278. * Use like:
  1279. * ZStatus_t zclGeneral_SendLevelControlStep( uint8 srcEP, afAddrType_t *dstAddr, uint8 stepMode, uint8 stepSize, uint16 transTime, uint8 disableDefaultRsp, uint8 seqNum );
  1280. */
  1281. #define zclGeneral_SendLevelControlStep(a,b,c,d,e,f,g) zclGeneral_SendLevelControlStepRequest( (a), (b), COMMAND_LEVEL_STEP, (c), (d), (e), (f), (g) )
  1282. /*
  1283. * Send out a Level Control Stop Command - COMMAND_LEVEL_STOP
  1284. * Use like:
  1285. * ZStatus_t zclGeneral_SendLevelControlStop( uint8 srcEP, afAddrType_t *dstAddr, uint8 disableDefaultRsp, uint8 seqNum );
  1286. */
  1287. #define zclGeneral_SendLevelControlStop(a,b,c,d) zcl_SendCommand( (a), (b), ZCL_CLUSTER_ID_GEN_LEVEL_CONTROL, COMMAND_LEVEL_STOP, TRUE, ZCL_FRAME_CLIENT_SERVER_DIR, (c), 0, (d), 0, NULL )
  1288. /*
  1289. * Send a Level Control Move to Level with On/Off Command - COMMAND_LEVEL_MOVE_TO_LEVEL_WITH_ON_OFF
  1290. * Use like:
  1291. * ZStatus_t zclGeneral_SendLevelControlMoveToLevelWithOnOff( uint16 srcEP, afAddrType_t *dstAddr, uint8 level, uint16 transTime, uint8 disableDefaultRsp, uint8 seqNum );
  1292. */
  1293. #define zclGeneral_SendLevelControlMoveToLevelWithOnOff(a,b,c,d,e,f) zclGeneral_SendLevelControlMoveToLevelRequest( (a), (b), COMMAND_LEVEL_MOVE_TO_LEVEL_WITH_ON_OFF, (c), (d), (e) ,(f) )
  1294. /*
  1295. * Send a Level Control Move with On/Off Command - COMMAND_LEVEL_MOVE_WITH_ON_OFF
  1296. * Use like:
  1297. * ZStatus_t zclGeneral_SendLevelControlMoveWithOnOff( uint8 srcEP, afAddrType_t *dstAddr, uint8 moveMode, uint8 rate, uint8 disableDefaultRsp, uint8 seqNum )
  1298. */
  1299. #define zclGeneral_SendLevelControlMoveWithOnOff(a,b,c,d,e,f) zclGeneral_SendLevelControlMoveRequest( (a), (b), COMMAND_LEVEL_MOVE_WITH_ON_OFF, (c), (d), (e), (f) )
  1300. /*
  1301. * Send out a Level Control Step with On/Off Command - COMMAND_LEVEL_STEP_WITH_ON_OFF
  1302. * Use like:
  1303. * ZStatus_t zclGeneral_SendLevelControlStepWithOnOff( uint8 srcEP, afAddrType_t *dstAddr, uint8 stepMode, uint8 stepSize, uint16 transTime, uint8 disableDefaultRsp, uint8 seqNum );
  1304. */
  1305. #define zclGeneral_SendLevelControlStepWithOnOff(a,b,c,d,e,f,g) zclGeneral_SendLevelControlStepRequest( (a), (b), COMMAND_LEVEL_STEP_WITH_ON_OFF, (c), (d), (e), (f), (g) )
  1306. /*
  1307. * Send out a Level Control Stop with On/Off Command - COMMAND_LEVEL_STOP_WITH_ON_OFF
  1308. * Use like:
  1309. * ZStatus_t zclGeneral_SendLevelControlStopWithOnOff( uint8 srcEP, afAddrType_t *dstAddr, uint8 disableDefaultRsp, uint8 seqNum );
  1310. */
  1311. #define zclGeneral_SendLevelControlStopWithOnOff(a,b,c,d) zcl_SendCommand( (a), (b), ZCL_CLUSTER_ID_GEN_LEVEL_CONTROL, COMMAND_LEVEL_STOP_WITH_ON_OFF, TRUE, ZCL_FRAME_CLIENT_SERVER_DIR, (c), 0, (d), 0, NULL )
  1312. #endif // ZCL_LEVEL_CTRL
  1313. #ifdef ZCL_ALARMS
  1314. /*
  1315. * Send an Alarm Reset Command - COMMAND_ALARMS_RESET
  1316. * Use like:
  1317. * ZStatus_t zclGeneral_SendAlarmReset( uint16 srcEP, afAddrType_t *dstAddr, uint8 alarmCode, uint16 clusterID, uint8 disableDefaultRsp, uint8 seqNum );
  1318. */
  1319. #define zclGeneral_SendAlarmReset(a,b,c,d,e,f) zclGeneral_SendAlarmRequest( (a), (b), COMMAND_ALARMS_RESET, (c), (d), (e), (f) )
  1320. /*
  1321. * Send an Alarm Reset ALL Command - COMMAND_ALARMS_RESET_ALL
  1322. * Use like:
  1323. * ZStatus_t zclGeneral_SendAlarmResetAll( uint16 srcEP, afAddrType_t *dstAddr, uint8 disableDefaultRsp, uint8 seqNum );
  1324. */
  1325. #define zclGeneral_SendAlarmResetAll(a,b,c,d) zcl_SendCommand( (a), (b), ZCL_CLUSTER_ID_GEN_ALARMS, COMMAND_ALARMS_RESET_ALL, TRUE, ZCL_FRAME_CLIENT_SERVER_DIR, (c), 0, (d), 0, NULL )
  1326. /*
  1327. * Send an Alarm Get Command - COMMAND_ALARMS_GET
  1328. * Use like:
  1329. * ZStatus_t zclGeneral_SendAlarmGet uint16 srcEP, afAddrType_t *dstAddr, uint8 disableDefaultRsp, uint8 seqNum );
  1330. */
  1331. #define zclGeneral_SendAlarmGet(a,b,c,d) zcl_SendCommand( (a), (b), ZCL_CLUSTER_ID_GEN_ALARMS, COMMAND_ALARMS_GET, TRUE, ZCL_FRAME_CLIENT_SERVER_DIR, (c), 0, (d), 0, NULL )
  1332. /*
  1333. * Send an Alarm Reset Log Command - COMMAND_ALARMS_RESET_LOG
  1334. * Use like:
  1335. * ZStatus_t zclGeneral_SendAlarmResetLog( uint16 srcEP, afAddrType_t *dstAddr, uint8 disableDefaultRsp, uint8 seqNum );
  1336. */
  1337. #define zclGeneral_SendAlarmResetLog(a,b,c,d) zcl_SendCommand( (a), (b), ZCL_CLUSTER_ID_GEN_ALARMS, COMMAND_ALARMS_RESET_LOG, TRUE, ZCL_FRAME_CLIENT_SERVER_DIR, (c), 0, (d), 0, NULL )
  1338. /*
  1339. * Send an Alarm Command - COMMAND_ALARMS_ALARM
  1340. * Use like:
  1341. * ZStatus_t zclGeneral_SendAlarm( uint16 srcEP, afAddrType_t *dstAddr, uint8 alarmCode, uint16 clusterID, uint8 disableDefaultRsp, uint8 seqNum );
  1342. */
  1343. #define zclGeneral_SendAlarm(a,b,c,d,e,f) zclGeneral_SendAlarmRequest( (a), (b), COMMAND_ALARMS_ALARM, (c), (d), (e), (f) )
  1344. #endif // ZCL_ALARMS
  1345. #ifdef ZCL_LOCATION
  1346. /*
  1347. * Send a Location Data Response Command - COMMAND_LOCATION_DATA_RSP
  1348. * Use like:
  1349. * ZStatus_t zclGeneral_SendLocationDataResponse( uint16 srcEP, afAddrType_t *dstAddr, zclLocationDataRsp_t *locData, uint8 disableDefaultRsp, uint8 seqNum );
  1350. */
  1351. #define zclGeneral_SendLocationDataResponse(a,b,c,d,e) zclGeneral_SendLocationData( (a), (b), COMMAND_LOCATION_DATA_RSP, ((c)->status), (&((c)->data)), (d), (e) )
  1352. /*
  1353. * Send a Location Data Notification Command - COMMAND_LOCATION_DATA_NOTIFICATION
  1354. * Use like:
  1355. * ZStatus_t zclGeneral_SendLocationDataNotif( uint16 srcEP, afAddrType_t *dstAddr, zclLocationData_t *locData, uint8 seqNum );
  1356. */
  1357. #define zclGeneral_SendLocationDataNotif(a,b,c,d) zclGeneral_SendLocationData( (a), (b), COMMAND_LOCATION_DATA_NOTIF, 0, (c), (d) )
  1358. /*
  1359. * Send a Location Data Compact Notification Command - COMMAND_LOCATION_COMPACT_DATA_NOTIFICATION
  1360. * Use like:
  1361. * ZStatus_t zclGeneral_SendLocationDataCompactNotif( uint16 srcEP, afAddrType_t *dstAddr, zclLocationData_t *locData, uint8 seqNum );
  1362. */
  1363. #define zclGeneral_SendLocationDataCompactNotif(a,b,c,d) zclGeneral_SendLocationData( (a), (b), COMMAND_LOCATION_DATA_COMPACT_NOTIF, 0, (c), (d) )
  1364. /*
  1365. * Send an RSSI Ping Command - COMMAND_LOCATION_RSSI_PING
  1366. * Use like:
  1367. * ZStatus_t zclGeneral_SendRSSIPing( uint16 srcEP, afAddrType_t *dstAddr, uint8 locationType, uint8 disableDefaultRsp, uint8 seqNum );
  1368. */
  1369. #define zclGeneral_SendRSSIPing(a,b,c,d,e) zcl_SendCommand( (a), (b), ZCL_CLUSTER_ID_GEN_LOCATION, COMMAND_LOCATION_RSSI_PING, TRUE, ZCL_FRAME_SERVER_CLIENT_DIR, (d), 0, (e), 1, (c) )
  1370. #endif // ZCL_LOCATION
  1371. /*********************************************************************
  1372. * FUNCTIONS
  1373. */
  1374. /*
  1375. * Register for callbacks from this cluster library
  1376. */
  1377. extern ZStatus_t zclGeneral_RegisterCmdCallbacks( uint8 endpoint, zclGeneral_AppCallbacks_t *callbacks );
  1378. #ifdef ZCL_LEVEL_CTRL
  1379. /*
  1380. * Call to send out a Level Control Move to Level Request
  1381. * cmd - Move or Move with On/Off
  1382. * level - what level to move to
  1383. * transitionTime - how long to take to get to the level (in seconds).
  1384. */
  1385. extern ZStatus_t zclGeneral_SendLevelControlMoveToLevelRequest( uint8 srcEP, afAddrType_t *dstAddr,
  1386. uint8 cmd, uint8 level, uint16 transTime,
  1387. uint8 disableDefaultRsp, uint8 seqNum );
  1388. /*
  1389. * Call to send out a Level Control Move Request
  1390. * cmd - Step or Step with On/Off
  1391. * moveMode - LEVEL_MOVE_UP or
  1392. * LEVEL_MOVE_DOWN
  1393. * rate - number of steps to take per second
  1394. */
  1395. extern ZStatus_t zclGeneral_SendLevelControlMoveRequest( uint8 srcEP, afAddrType_t *dstAddr,
  1396. uint8 cmd, uint8 moveMode, uint8 rate,
  1397. uint8 disableDefaultRsp, uint8 seqNum );
  1398. /*
  1399. * Call to send out a Level Control Step Request
  1400. * cmd - Step or Step with On/Off
  1401. * stepMode - LEVEL_STEP_UP or
  1402. * LEVEL_STEP_DOWN
  1403. * amount - number of levels to step
  1404. * transitionTime - time to take to perform a single step
  1405. */
  1406. extern ZStatus_t zclGeneral_SendLevelControlStepRequest( uint8 srcEP, afAddrType_t *dstAddr,
  1407. uint8 cmd, uint8 stepMode, uint8 stepSize, uint16 transTime,
  1408. uint8 disableDefaultRsp, uint8 seqNum );
  1409. #endif // ZCL_LEVEL_CTRL
  1410. #ifdef ZCL_GROUPS
  1411. /*
  1412. * Send Group Response (not Group View Response)
  1413. * - Use MACROS instead:
  1414. * zclGeneral_SendGroupAddResponse or zclGeneral_SendGroupRemoveResponse
  1415. */
  1416. extern ZStatus_t zclGeneral_SendGroupResponse( uint8 srcEP, afAddrType_t *dstAddr,
  1417. uint8 cmd, uint8 status, uint16 groupID,
  1418. uint8 disableDefaultRsp, uint8 seqNum );
  1419. /*
  1420. * Call to send Group Response Command
  1421. */
  1422. extern ZStatus_t zclGeneral_SendGroupViewResponse( uint8 srcEP, afAddrType_t *dstAddr,
  1423. uint8 status, aps_Group_t *grp,
  1424. uint8 disableDefaultRsp, uint8 seqNum );
  1425. /*
  1426. * Call to send Group Membership Command
  1427. */
  1428. extern ZStatus_t zclGeneral_SendGroupGetMembershipRequest( uint8 srcEP, afAddrType_t *dstAddr,
  1429. uint8 cmd, uint8 rspCmd, uint8 direction, uint8 capacity,
  1430. uint8 grpCnt, uint16 *grpList, uint8 disableDefaultRsp, uint8 seqNum );
  1431. #endif // ZCL_GROUPS
  1432. #ifdef ZCL_SCENES
  1433. /*
  1434. * Add a scene for an endpoint
  1435. */
  1436. extern ZStatus_t zclGeneral_AddScene( uint8 endpoint, zclGeneral_Scene_t *scene );
  1437. /*
  1438. * Find a scene with endpoint and sceneID
  1439. */
  1440. extern zclGeneral_Scene_t *zclGeneral_FindScene( uint8 endpoint, uint16 groupID, uint8 sceneID );
  1441. /*
  1442. * Get all the scenes with groupID
  1443. */
  1444. extern uint8 zclGeneral_FindAllScenesForGroup( uint8 endpoint, uint16 groupID, uint8 *sceneList );
  1445. /*
  1446. * Remove a scene with endpoint and sceneID
  1447. */
  1448. extern uint8 zclGeneral_RemoveScene( uint8 endpoint, uint16 groupID, uint8 sceneID );
  1449. /*
  1450. * Remove all scenes for an endpoint
  1451. */
  1452. extern void zclGeneral_RemoveAllScenes( uint8 endpoint, uint16 groupID );
  1453. /*
  1454. * Count the number of scenes for an endpoint
  1455. */
  1456. extern uint8 zclGeneral_CountScenes( uint8 endpoint );
  1457. /*
  1458. * Count the number of scenes
  1459. */
  1460. extern uint8 zclGeneral_CountAllScenes( void );
  1461. /*
  1462. * Read callback function for the Scene Count attribute.
  1463. */
  1464. extern ZStatus_t zclGeneral_ReadSceneCountCB( uint16 clusterId, uint16 attrId,
  1465. uint8 oper, uint8 *pValue, uint16 *pLen );
  1466. /*
  1467. * Add Scene Request message
  1468. */
  1469. extern ZStatus_t zclGeneral_SendAddScene( uint8 srcEP, afAddrType_t *dstAddr,
  1470. zclGeneral_Scene_t *scene,
  1471. uint8 disableDefaultRsp, uint8 seqNum );
  1472. /*
  1473. * Send a Scene command (request) - not Scene Add
  1474. */
  1475. extern ZStatus_t zclGeneral_SendSceneRequest( uint8 srcEP, afAddrType_t *dstAddr,
  1476. uint8 cmd, uint16 groupID, uint8 sceneID,
  1477. uint8 disableDefaultRsp, uint8 seqNum );
  1478. /*
  1479. * Send Scene response messages for either COMMAND_SCENE_ADD_RSP,
  1480. * COMMAND_SCENE_REMOVE_RSP or COMMAND_SCENE_STORE_RSP
  1481. */
  1482. extern ZStatus_t zclGeneral_SendSceneResponse( uint8 srcEP, afAddrType_t *dstAddr,
  1483. uint8 cmd, uint8 status, uint16 groupID,
  1484. uint8 sceneID, uint8 disableDefaultRsp, uint8 seqNum );
  1485. /*
  1486. * Send Scene View response message
  1487. */
  1488. extern ZStatus_t zclGeneral_SendSceneViewResponse( uint8 srcEP, afAddrType_t *dstAddr,
  1489. uint8 status, zclGeneral_Scene_t *scene,
  1490. uint8 disableDefaultRsp, uint8 seqNum );
  1491. /*
  1492. * Send Scene Get Membership response message
  1493. */
  1494. extern ZStatus_t zclGeneral_SendSceneGetMembershipResponse( uint8 srcEP, afAddrType_t *dstAddr,
  1495. uint8 sceneStatus, uint8 capacity, uint8 sceneCnt, uint8 *sceneList,
  1496. uint16 groupID, uint8 disableDefaultRsp, uint8 seqNum );
  1497. #endif // ZCL_SCENES
  1498. #ifdef ZCL_GROUPS
  1499. /*
  1500. * Send a Group command (request) - not Group Add or Remove All
  1501. */
  1502. extern ZStatus_t zclGeneral_SendGroupRequest( uint8 srcEP, afAddrType_t *dstAddr,
  1503. uint8 cmd, uint16 groupID,
  1504. uint8 disableDefaultRsp, uint8 seqNum );
  1505. /*
  1506. * Send a Group Add command (request)
  1507. * groupName - pointer to Group Name. This is a Zigbee
  1508. * string data type, so the first byte is the length of the
  1509. * name (in bytes), then the name.
  1510. */
  1511. extern ZStatus_t zclGeneral_SendAddGroupRequest( uint8 srcEP, afAddrType_t *dstAddr,
  1512. uint8 cmd, uint16 groupID, uint8 *groupName,
  1513. uint8 disableDefaultRsp, uint8 seqNum );
  1514. #endif // ZCL_GROUPS
  1515. #ifdef ZCL_IDENTIFY
  1516. /*
  1517. * Send a Identify message
  1518. */
  1519. extern ZStatus_t zclGeneral_SendIdentify( uint8 srcEP, afAddrType_t *dstAddr,
  1520. uint16 identifyTime, uint8 disableDefaultRsp, uint8 seqNum );
  1521. /*
  1522. * Send a Identify Query Response message
  1523. */
  1524. extern ZStatus_t zclGeneral_SendIdentifyQueryResponse( uint8 srcEP, afAddrType_t *dstAddr,
  1525. uint16 timeout, uint8 disableDefaultRsp, uint8 seqNum );
  1526. #endif // ZCL_IDENTIFY
  1527. #ifdef ZCL_ALARMS
  1528. /*
  1529. * Send out an Alarm Request Command
  1530. */
  1531. extern ZStatus_t zclGeneral_SendAlarmRequest( uint8 srcEP, afAddrType_t *dstAddr,
  1532. uint8 cmd, uint8 alarmCode, uint16 clusterID,
  1533. uint8 disableDefaultRsp, uint8 seqNum );
  1534. /*
  1535. * Send out an Alarm Get Response Command
  1536. */
  1537. extern ZStatus_t zclGeneral_SendAlarmGetRespnose( uint8 srcEP, afAddrType_t *dstAddr,
  1538. uint8 status, uint8 alarmCode, uint16 clusterID,
  1539. uint32 timeStamp, uint8 disableDefaultRsp, uint8 seqNum );
  1540. /*
  1541. * Send out an Alarm Get Event Log Command
  1542. */
  1543. ZStatus_t zclGeneral_SendAlarmGetEventLog( uint8 srcEP, afAddrType_t *dstAddr,
  1544. zclGetEventLog_t *pEventLog,
  1545. uint8 disableDefaultRsp, uint8 seqNum );
  1546. /*
  1547. * Send out an an Alarm Publish Event Log Command
  1548. */
  1549. extern ZStatus_t zclGeneral_SendAlarmPublishEventLog( uint8 srcEP, afAddrType_t *dstAddr,
  1550. zclPublishEventLog_t *pEventLog,
  1551. uint8 disableDefaultRsp, uint8 seqNum );
  1552. #endif // ZCL_ALARMS
  1553. #ifdef ZCL_LOCATION
  1554. /*
  1555. * Send a Set Absolute Location message
  1556. */
  1557. extern ZStatus_t zclGeneral_SendLocationSetAbsolute( uint8 srcEP, afAddrType_t *dstAddr,
  1558. zclLocationAbsolute_t *absLoc,
  1559. uint8 disableDefaultRsp, uint8 seqNum );
  1560. /*
  1561. * Send a Set Device Configuration message
  1562. */
  1563. extern ZStatus_t zclGeneral_SendLocationSetDevCfg( uint8 srcEP, afAddrType_t *dstAddr,
  1564. zclLocationDevCfg_t *devCfg,
  1565. uint8 disableDefaultRsp, uint8 seqNum );
  1566. /*
  1567. * Send a Get Device Configuration message
  1568. */
  1569. extern ZStatus_t zclGeneral_SendLocationGetDevCfg( uint8 srcEP, afAddrType_t *dstAddr,
  1570. uint8 *targetAddr, uint8 disableDefaultRsp, uint8 seqNum );
  1571. /*
  1572. * Send a Get Location Data message
  1573. */
  1574. extern ZStatus_t zclGeneral_SendLocationGetData( uint8 srcEP, afAddrType_t *dstAddr,
  1575. zclLocationGetData_t *locData,
  1576. uint8 disableDefaultRsp, uint8 seqNum );
  1577. /*
  1578. * Send a Set Device Configuration Response message
  1579. */
  1580. extern ZStatus_t zclGeneral_SendLocationDevCfgResponse( uint8 srcEP, afAddrType_t *dstAddr,
  1581. zclLocationDevCfgRsp_t *devCfg,
  1582. uint8 disableDefaultRsp, uint8 seqNum );
  1583. /*
  1584. * Send a Location Data Response, Location Data Notification or Compact Location
  1585. * Data Notification message.
  1586. */
  1587. extern ZStatus_t zclGeneral_SendLocationData( uint8 srcEP, afAddrType_t *dstAddr, uint8 cmd,
  1588. uint8 status, zclLocationData_t *locData,
  1589. uint8 disableDefaultRsp, uint8 seqNum );
  1590. #endif // ZCL_LOCATION
  1591. #ifdef ZCL_ALARMS
  1592. /*
  1593. * Add an alarm for a cluster
  1594. */
  1595. extern ZStatus_t zclGeneral_AddAlarm( uint8 endpoint, zclGeneral_Alarm_t *alarm );
  1596. /*
  1597. * Find an alarm with alarmCode and clusterID
  1598. */
  1599. extern zclGeneral_Alarm_t *zclGeneral_FindAlarm( uint8 endpoint, uint8 alarmCode, uint16 clusterID );
  1600. /*
  1601. * Find an alarm with the earliest timestamp
  1602. */
  1603. extern zclGeneral_Alarm_t *zclGeneral_FindEarliestAlarm( uint8 endpoint );
  1604. /*
  1605. * Remove a scene with endpoint and sceneID
  1606. */
  1607. extern void zclGeneral_ResetAlarm( uint8 endpoint, uint8 alarmCode, uint16 clusterID );
  1608. /*
  1609. * Remove all scenes with endpoint
  1610. */
  1611. extern void zclGeneral_ResetAllAlarms( uint8 endpoint, uint8 notifyApp );
  1612. #endif // ZCL_ALARMS
  1613. /*********************************************************************
  1614. *********************************************************************/
  1615. #ifdef __cplusplus
  1616. }
  1617. #endif
  1618. #endif /* ZCL_GENERAL_H */