zcl_general.h 61 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327
  1. /**************************************************************************************************
  2. Filename: zcl_general.h
  3. Revised: $Date: 2009-04-06 09:08:36 -0700 (Mon, 06 Apr 2009) $
  4. Revision: $Revision: 19702 $
  5. Description: This file contains the ZCL General definitions.
  6. Copyright 2006-2008 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. // Specified per Profile 0x01-0x7F
  81. #define PHY_UNKNOWN_ENV 0xFF
  82. /*** Device Enable Attribute values ***/
  83. #define DEVICE_DISABLED 0x00
  84. #define DEVICE_ENABLED 0x01
  85. /*** Alarm Mask Attribute bits ***/
  86. #define ALARM_MASK_GEN_HW_FAULT 0x01
  87. #define ALARM_MASK_GEN_SW_FAULT 0x02
  88. /******************************/
  89. /*** Basic Cluster Commands ***/
  90. /******************************/
  91. #define COMMAND_BASIC_RESET_FACT_DEFAULT 0x00
  92. /**********************************************/
  93. /*** Power Configuration Cluster Attributes ***/
  94. /**********************************************/
  95. // Mains Information
  96. #define ATTRID_POWER_CFG_MAINS_VOLTAGE 0x0000
  97. #define ATTRID_POWER_CFG_MAINS_FREQUENCY 0x0001
  98. // Mains Settings
  99. #define ATTRID_POWER_CFG_MAINS_ALARM_MASK 0x0010
  100. #define ATTRID_POWER_CFG_MAINS_VOLT_MIN_THRES 0x0011
  101. #define ATTRID_POWER_CFG_MAINS_VOLT_MAX_THRES 0x0012
  102. #define ATTRID_POWER_CFG_MAINS_DWELL_TRIP_POINT 0x0013
  103. // Battery Information
  104. #define ATTRID_POWER_CFG_BATTERY_VOLTAGE 0x0020
  105. // Battery Settings
  106. #define ATTRID_POWER_CFG_BAT_MANU 0x0030
  107. #define ATTRID_POWER_CFG_BAT_SIZE 0x0031
  108. #define ATTRID_POWER_CFG_BAT_AHR_RATING 0x0032
  109. #define ATTRID_POWER_CFG_BAT_QUANTITY 0x0033
  110. #define ATTRID_POWER_CFG_BAT_RATED_VOLTAGE 0x0034
  111. #define ATTRID_POWER_CFG_BAT_ALARM_MASK 0x0035
  112. #define ATTRID_POWER_CFG_BAT_VOLT_MIN_THRES 0x0036
  113. /*** Mains Alarm Mask Attribute bit ***/
  114. #define MAINS_ALARM_MASK_VOLT_2_LOW 0x01
  115. #define MAINS_ALARM_MASK_VOLT_2_HI 0x02
  116. /*** Battery Size Attribute values ***/
  117. #define BAT_SIZE_NO_BATTERY 0x00
  118. #define BAT_SIZE_BUILT_IN 0x01
  119. #define BAT_SIZE_OTHER 0x02
  120. #define BAT_SIZE_AA 0x03
  121. #define BAT_SIZE_AAA 0x04
  122. #define BAT_SIZE_C 0x05
  123. #define BAT_SIZE_D 0x06
  124. #define BAT_SIZE_UNKNOWN 0xFF
  125. /*** Batter Alarm Mask Attribute bit ***/
  126. #define BAT_ALARM_MASK_VOLT_2_LOW 0x01
  127. /********************************************/
  128. /*** Power Configuration Cluster Commands ***/
  129. /********************************************/
  130. // No cluster specific commands
  131. /***********************************************************/
  132. /*** Device Temperature Configuration Cluster Attributes ***/
  133. /***********************************************************/
  134. // Device Temperature Information
  135. #define ATTRID_DEV_TEMP_CURRENT 0x0000
  136. #define ATTRID_DEV_TEMP_MIN_EXPERIENCED 0x0001
  137. #define ATTRID_DEV_TEMP_MAX_EXPERIENCED 0x0002
  138. #define ATTRID_DEV_TEMP_OVER_TOTAL_DWELL 0x0003
  139. // Device Temperature Settings
  140. #define ATTRID_DEV_TEMP_ALARM_MASK 0x0010
  141. #define ATTRID_DEV_TEMP_LOW_THRES 0x0011
  142. #define ATTRID_DEV_TEMP_HI_THRES 0x0012
  143. #define ATTRID_DEV_TEMP_LOW_DWELL_TRIP_POINT 0x0013
  144. #define ATTRID_DEV_TEMP_HI_DWELL_TRIP_POINT 0x0014
  145. /*** Device Temp Alarm_Mask Attribute bits ***/
  146. #define DEV_TEMP_ALARM_MASK_2_LOW 0x01
  147. #define DEV_TEMP_ALARM_MASK_2_HI 0x02
  148. /*********************************************************/
  149. /*** Device Temperature Configuration Cluster Commands ***/
  150. /*********************************************************/
  151. // No cluster specific commands
  152. /***********************************/
  153. /*** Identify Cluster Attributes ***/
  154. /***********************************/
  155. #define ATTRID_IDENTIFY_TIME 0x0000
  156. /*********************************/
  157. /*** Identify Cluster Commands ***/
  158. /*********************************/
  159. #define COMMAND_IDENTIFY 0x00
  160. #define COMMAND_IDENTIFY_QUERY 0x01
  161. #define COMMAND_IDENTIFY_QUERY_RSP 0x00
  162. /********************************/
  163. /*** Group Cluster Attributes ***/
  164. /********************************/
  165. #define ATTRID_GROUP_NAME_SUPPORT 0x0000
  166. /******************************/
  167. /*** Group Cluster Commands ***/
  168. /******************************/
  169. #define COMMAND_GROUP_ADD 0x00
  170. #define COMMAND_GROUP_VIEW 0x01
  171. #define COMMAND_GROUP_GET_MEMBERSHIP 0x02
  172. #define COMMAND_GROUP_REMOVE 0x03
  173. #define COMMAND_GROUP_REMOVE_ALL 0x04
  174. #define COMMAND_GROUP_ADD_IF_IDENTIFYING 0x05
  175. #define COMMAND_GROUP_ADD_RSP 0x00
  176. #define COMMAND_GROUP_VIEW_RSP 0x01
  177. #define COMMAND_GROUP_GET_MEMBERSHIP_RSP 0x02
  178. #define COMMAND_GROUP_REMOVE_RSP 0x03
  179. /*********************************/
  180. /*** Scenes Cluster Attributes ***/
  181. /*********************************/
  182. // Scene Management Information
  183. #define ATTRID_SCENES_COUNT 0x0000
  184. #define ATTRID_SCENES_CURRENT_SCENE 0x0001
  185. #define ATTRID_SCENES_CURRENT_GROUP 0x0002
  186. #define ATTRID_SCENES_SCENE_VALID 0x0003
  187. #define ATTRID_SCENES_NAME_SUPPORT 0x0004
  188. #define ATTRID_SCENES_LAST_CFG_BY 0x0005
  189. /*******************************/
  190. /*** Scenes Cluster Commands ***/
  191. /*******************************/
  192. #define COMMAND_SCENE_ADD 0x00
  193. #define COMMAND_SCENE_VIEW 0x01
  194. #define COMMAND_SCENE_REMOVE 0x02
  195. #define COMMAND_SCENE_REMOVE_ALL 0x03
  196. #define COMMAND_SCENE_STORE 0x04
  197. #define COMMAND_SCENE_RECALL 0x05
  198. #define COMMAND_SCENE_GET_MEMBERSHIP 0x06
  199. #define COMMAND_SCENE_ADD_RSP 0x00
  200. #define COMMAND_SCENE_VIEW_RSP 0x01
  201. #define COMMAND_SCENE_REMOVE_RSP 0x02
  202. #define COMMAND_SCENE_REMOVE_ALL_RSP 0x03
  203. #define COMMAND_SCENE_STORE_RSP 0x04
  204. #define COMMAND_SCENE_GET_MEMBERSHIP_RSP 0x06
  205. /*********************************/
  206. /*** On/Off Cluster Attributes ***/
  207. /*********************************/
  208. #define ATTRID_ON_OFF 0x0000
  209. /*******************************/
  210. /*** On/Off Cluster Commands ***/
  211. /*******************************/
  212. #define COMMAND_OFF 0x00
  213. #define COMMAND_ON 0x01
  214. #define COMMAND_TOGGLE 0x02
  215. /****************************************/
  216. /*** On/Off Switch Cluster Attributes ***/
  217. /****************************************/
  218. // Switch Information
  219. #define ATTRID_ON_OFF_SWITCH_TYPE 0x0000
  220. // Switch Settings
  221. #define ATTRID_ON_OFF_SWITCH_ACTIONS 0x0010
  222. /*** On Off Switch Type attribute values ***/
  223. #define ON_OFF_SWITCH_TYPE_TOGGLE 0x00
  224. #define ON_OFF_SWITCH_TYPE_MOMENTARY 0x01
  225. /*** On Off Switch Actions attribute values ***/
  226. #define ON_OFF_SWITCH_ACTIONS_0 0x00
  227. #define ON_OFF_SWITCH_ACTIONS_1 0x01
  228. #define ON_OFF_SWITCH_ACTIONS_2 0x02
  229. /**************************************/
  230. /*** On/Off Switch Cluster Commands ***/
  231. /**************************************/
  232. // No cluster specific commands
  233. /****************************************/
  234. /*** Level Control Cluster Attributes ***/
  235. /****************************************/
  236. #define ATTRID_LEVEL_CURRENT_LEVEL 0x0000
  237. #define ATTRID_LEVEL_REMAINING_TIME 0x0001
  238. #define ATTRID_LEVEL_ON_OFF_TRANSITION_TIME 0x0010
  239. #define ATTRID_LEVEL_ON_LEVEL 0x0011
  240. /**************************************/
  241. /*** Level Control Cluster Commands ***/
  242. /**************************************/
  243. #define COMMAND_LEVEL_MOVE_TO_LEVEL 0x00
  244. #define COMMAND_LEVEL_MOVE 0x01
  245. #define COMMAND_LEVEL_STEP 0x02
  246. #define COMMAND_LEVEL_STOP 0x03
  247. #define COMMAND_LEVEL_MOVE_TO_LEVEL_WITH_ON_OFF 0x04
  248. #define COMMAND_LEVEL_MOVE_WITH_ON_OFF 0x05
  249. #define COMMAND_LEVEL_STEP_WITH_ON_OFF 0x06
  250. #define COMMAND_LEVEL_STOP_WITH_ON_OFF 0x07
  251. /*** Level Control Move (Mode) Command values ***/
  252. #define LEVEL_MOVE_UP 0x00
  253. #define LEVEL_MOVE_DOWN 0x01
  254. /*** Level Control Step (Mode) Command values ***/
  255. #define LEVEL_STEP_UP 0x00
  256. #define LEVEL_STEP_DOWN 0x01
  257. /*********************************/
  258. /*** Alarms Cluster Attributes ***/
  259. /*********************************/
  260. // Alarm Information
  261. #define ATTRID_ALARM_COUNT 0x0000
  262. /*******************************/
  263. /*** Alarms Cluster Commands ***/
  264. /*******************************/
  265. #define COMMAND_ALARMS_RESET 0x00
  266. #define COMMAND_ALARMS_RESET_ALL 0x01
  267. #define COMMAND_ALARMS_GET 0x02
  268. #define COMMAND_ALARMS_RESET_LOG 0x03
  269. #define COMMAND_ALARMS_ALARM 0x00
  270. #define COMMAND_ALARMS_GET_RSP 0x01
  271. /*******************************/
  272. /*** Time Cluster Attributes ***/
  273. /*******************************/
  274. #define ATTRID_TIME_TIME 0x00
  275. #define ATTRID_TIME_STATUS 0x01
  276. /*** TimeStatus Attribute bits ***/
  277. #define TIME_STATUS_MASTER 0x01
  278. #define TIME_STATUS_SYNCH 0x02
  279. /*****************************/
  280. /*** Time Cluster Commands ***/
  281. /*****************************/
  282. // No cluster specific commands
  283. /***********************************/
  284. /*** RSSI Location Cluster Attributes ***/
  285. /***********************************/
  286. // Location Information
  287. #define ATTRID_LOCATION_TYPE 0x0000
  288. #define ATTRID_LOCATION_METHOD 0x0001
  289. #define ATTRID_LOCATION_AGE 0x0002
  290. #define ATTRID_LOCATION_QUALITY_MEASURE 0x0003
  291. #define ATTRID_LOCATION_NUM_DEVICES 0x0004
  292. // Location Settings
  293. #define ATTRID_LOCATION_COORDINATE1 0x0010
  294. #define ATTRID_LOCATION_COORDINATE2 0x0011
  295. #define ATTRID_LOCATION_COORDINATE3 0x0012
  296. #define ATTRID_LOCATION_POWER 0x0013
  297. #define ATTRID_LOCATION_PATH_LOSS_EXPONENT 0x0014
  298. #define ATTRID_LOCATION_REPORT_PERIOD 0x0015
  299. #define ATTRID_LOCATION_CALC_PERIOD 0x0016
  300. #define ATTRID_LOCATION_NUM_RSSI_MEASUREMENTS 0x0017
  301. /*** Location Type attribute bits ***/
  302. #define LOCATION_TYPE_ABSOLUTE 0x01
  303. #define LOCATION_TYPE_2_D 0x02
  304. #define LOCATION_TYPE_COORDINATE_SYSTEM 0x0C
  305. /*** Location Method attribute values ***/
  306. #define LOCATION_METHOD_LATERATION 0x00
  307. #define LOCATION_METHOD_SIGNPOSTING 0x01
  308. #define LOCATION_METHOD_RF_FINGER_PRINT 0x02
  309. #define LOCATION_METHOD_OUT_OF_BAND 0x03
  310. /*********************************/
  311. /*** Location Cluster Commands ***/
  312. /*********************************/
  313. #define COMMAND_LOCATION_SET_ABSOLUTE 0x00
  314. #define COMMAND_LOCATION_SET_DEV_CFG 0x01
  315. #define COMMAND_LOCATION_GET_DEV_CFG 0x02
  316. #define COMMAND_LOCATION_GET_DATA 0x03
  317. #define COMMAND_LOCATION_DEV_CFG_RSP 0x00
  318. #define COMMAND_LOCATION_DATA_RSP 0x01
  319. #define COMMAND_LOCATION_DATA_NOTIF 0x02
  320. #define COMMAND_LOCATION_COMPACT_DATA_NOTIF 0x03
  321. #define COMMAND_LOCATION_RSSI_PING 0x04
  322. // The maximum number of characters to allow in a scene's name
  323. // remember that the first byte is the length
  324. #define ZCL_GEN_SCENE_NAME_LEN 16
  325. // The maximum length of the scene extension field:
  326. // 2 + 1 + 1 for On/Off cluster (onOff attibute)
  327. // 2 + 1 + 1 for Level Control cluster (currentLevel attribute)
  328. // 2 + 1 + 4 for Color Control cluster (currentX/currentY attributes)
  329. #define ZCL_GEN_SCENE_EXT_LEN 15
  330. // The maximum number of entries in the Scene table
  331. #define ZCL_GEN_MAX_SCENES 16
  332. /*********************************************************************
  333. * TYPEDEFS
  334. */
  335. // The format of a Scene Table Entry
  336. typedef struct
  337. {
  338. uint16 groupID; // The group ID for which this scene applies
  339. uint8 ID; // Scene ID
  340. uint16 transTime; // Time to take to transition to this scene
  341. uint8 name[ZCL_GEN_SCENE_NAME_LEN]; // Scene name
  342. uint8 extLen; // Length of extension fields
  343. uint8 extField[ZCL_GEN_SCENE_EXT_LEN]; // Extension fields
  344. } zclGeneral_Scene_t;
  345. // The format of an Alarm Table entry
  346. typedef struct
  347. {
  348. uint8 code; // Identifying code for the cause of the alarm
  349. uint16 clusterID; // The id of the cluster whose attribute generated this alarm
  350. uint32 timeStamp; // The time at which the alarm occured
  351. } zclGeneral_Alarm_t;
  352. /*** RSSI Location Cluster Data Types ***/
  353. // Set Absolute Location Command format
  354. typedef struct
  355. {
  356. int16 coordinate1;
  357. int16 coordinate2;
  358. int16 coordinate3;
  359. int16 power;
  360. uint16 pathLossExponent;
  361. } zclLocationAbsolute_t;
  362. // Set Device Configuration Command format
  363. typedef struct
  364. {
  365. int16 power;
  366. uint16 pathLossExponent;
  367. uint16 calcPeriod;
  368. uint8 numMeasurements;
  369. uint16 reportPeriod;
  370. } zclLocationDevCfg_t;
  371. // Get Location Data Command format
  372. typedef struct
  373. {
  374. unsigned int absOnly:1; // Absolute Only
  375. unsigned int recalc:1; // Re-calculate
  376. unsigned int brdcastIndic:1; // Broadcast Indicator
  377. unsigned int brdcastRsp:1; // Broadcast Response
  378. unsigned int compactRsp:1; // Compact Response
  379. unsigned int reserved:3; // Reserved for future use
  380. } locationbits_t;
  381. typedef union
  382. {
  383. locationbits_t locBits;
  384. uint8 locByte;
  385. } location_t;
  386. typedef struct
  387. {
  388. location_t bitmap;
  389. uint8 numResponses;
  390. uint8 targetAddr[8];
  391. // shorthand access
  392. #define absoluteOnly bitmap.locBits.absOnly
  393. #define recalculate bitmap.locBits.recalc
  394. #define brdcastIndicator bitmap.locBits.brdcastIndic
  395. #define brdcastResponse bitmap.locBits.brdcastRsp
  396. #define compactResponse bitmap.locBits.compactRsp
  397. } zclLocationGetData_t;
  398. // Device Configuration Response Command format
  399. typedef struct
  400. {
  401. uint8 status;
  402. zclLocationDevCfg_t data;
  403. } zclLocationDevCfgRsp_t;
  404. // Calculated Location Data type
  405. typedef struct
  406. {
  407. uint8 locationMethod;
  408. uint8 qualityMeasure;
  409. uint16 locationAge;
  410. } zclLocationCalculated_t;
  411. // Location Data Type
  412. typedef struct
  413. {
  414. uint8 type;
  415. zclLocationAbsolute_t absLoc;
  416. zclLocationCalculated_t calcLoc;
  417. } zclLocationData_t;
  418. // Location Data Response Command format
  419. typedef struct
  420. {
  421. uint8 status;
  422. zclLocationData_t data;
  423. } zclLocationDataRsp_t;
  424. /*** Structures used for callback functions ***/
  425. typedef struct
  426. {
  427. afAddrType_t *srcAddr; // requestor's address
  428. uint16 identifyTime; // number of seconds the device will continue to identify itself
  429. } zclIdentify_t;
  430. typedef struct
  431. {
  432. afAddrType_t *srcAddr; // requestor's address
  433. uint16 timeout; // number of seconds the device will continue to identify itself
  434. } zclIdentifyQueryRsp_t;
  435. typedef struct
  436. {
  437. uint8 level; // new level to move to
  438. uint16 transitionTime; // time to take to move to the new level (in seconds)
  439. uint8 withOnOff; // with On/off command
  440. } zclLCMoveToLevel_t;
  441. typedef struct
  442. {
  443. uint8 moveMode; // move mode which is either LEVEL_MOVE_STOP, LEVEL_MOVE_UP,
  444. // LEVEL_MOVE_ON_AND_UP, LEVEL_MOVE_DOWN, or LEVEL_MOVE_DOWN_AND_OFF
  445. uint8 rate; // rate of movement in steps per second
  446. uint8 withOnOff; // with On/off command
  447. } zclLCMove_t;
  448. typedef struct
  449. {
  450. uint8 stepMode; // step mode which is either LEVEL_STEP_UP, LEVEL_STEP_ON_AND_UP,
  451. // LEVEL_STEP_DOWN, or LEVEL_STEP_DOWN_AND_OFF
  452. uint8 amount; // number of levels to step
  453. uint16 transitionTime; // time, in 1/10ths of a second, to take to perform the step
  454. uint8 withOnOff; // with On/off command
  455. } zclLCStep_t;
  456. typedef struct
  457. {
  458. afAddrType_t *srcAddr; // requestor's address
  459. uint8 cmdID; // which group message - COMMAND_GROUP_ADD_RSP, COMMAND_GROUP_VIEW_RSP,
  460. // COMMAND_GROUP_REMOVE_RSP or COMMAND_GROUP_GET_MEMBERSHIP_RSP
  461. uint8 status; // GROUP_STATUS_SUCCESS, GROUP_STATUS_TABLE_FULL,
  462. // GROUP_STATUS_ALREADY_IN_TABLE, or GROUP_STATUS_NOT_IN_TABLE. Not
  463. // valid for COMMAND_GROUP_GET_MEMBERSHIP_RSP
  464. uint8 grpCnt; // number of groups contained in group list
  465. uint16 *grpList; // what group IDs the action was performed on
  466. uint8 capacity; // remaining capacity of group table
  467. uint8 *grpName; // only valid for COMMAND_GROUP_VIEW_RSP
  468. } zclGroupRsp_t;
  469. typedef struct
  470. {
  471. afAddrType_t *srcAddr; // requestor's address
  472. zclGeneral_Scene_t *scene; // pointer to the scene structure
  473. } zclSceneReq_t;
  474. typedef struct
  475. {
  476. afAddrType_t *srcAddr; // requestor's address
  477. uint8 cmdID; // which response - COMMAND_SCENE_ADD_RSP, COMMAND_SCENE_VIEW_RSP,
  478. // COMMAND_SCENE_REMOVE_RSP, COMMAND_SCENE_REMOVE_ALL_RSP,
  479. // COMMAND_SCENE_STORE_RSP or COMMAND_SCENE_GET_MEMBERSHIPSHIP_RSP
  480. uint8 status; // response status
  481. uint8 sceneCnt; // number of scenes in the scene list (only valid for
  482. // COMMAND_SCENE_GET_MEMBERSHIPSHIP_RSP)
  483. uint8 *sceneList; // list of scene IDs (only valid for COMMAND_SCENE_GET_MEMBERSHIPSHIP_RSP)
  484. uint8 capacity; // remaining capacity of the scene table (only valid for
  485. // COMMAND_SCENE_GET_MEMBERSHIPSHIP_RSP)
  486. zclGeneral_Scene_t *scene; // pointer to the scene structure
  487. } zclSceneRsp_t;
  488. typedef struct
  489. {
  490. afAddrType_t *srcAddr; // requestor's address
  491. uint8 cmdID; // COMMAND_ALARMS_ALARM or COMMAND_ALARMS_GET_RSP
  492. uint8 status; // response status (only applicable to COMMAND_ALARMS_GET_RSP)
  493. uint8 alarmCode; // response status (only applicable to COMMAND_ALARMS_GET_RSP)
  494. uint16 clusterID; // the id of the cluster whose attribute generated this alarm
  495. uint32 timeStamp; // the time at which the alarm occurred (only applicable to
  496. // COMMAND_ALARMS_GET_RSP)
  497. } zclAlarm_t;
  498. typedef struct
  499. {
  500. afAddrType_t *srcAddr; // requestor's address
  501. uint8 cmdID; // COMMAND_LOCATION_SET_ABSOLUTE, COMMAND_LOCATION_SET_DEV_CFG,
  502. // COMMAND_LOCATION_GET_DEV_CFG or COMMAND_LOCATION_GET_DATA
  503. union
  504. {
  505. zclLocationAbsolute_t absLoc; // Absolute Location info (only valid for COMMAND_LOCATION_SET_ABSOLUTE)
  506. zclLocationGetData_t loc; // Get Location info (only valid for COMMAND_LOCATION_GET_DATA)
  507. zclLocationDevCfg_t devCfg; // Device Config info (only valid for COMMAND_LOCATION_SET_DEV_CFG)
  508. uint8 *ieeeAddr; // Device's IEEE Addr (only valid for COMMAND_LOCATION_GET_DEV_CFG)
  509. } un;
  510. uint8 seqNum; // Sequence number received with the message (only valid for GET commands)
  511. } zclLocation_t;
  512. typedef struct
  513. {
  514. afAddrType_t *srcAddr; // requestor's address
  515. uint8 cmdID; // COMMAND_LOCATION_DEV_CFG_RSP, COMMAND_LOCATION_DATA_RSP,
  516. // COMMAND_LOCATION_DATA_NOTIF, COMMAND_LOCATION_COMPACT_DATA_NOTIF
  517. // or COMMAND_LOCATION_RSSI_PING
  518. union
  519. {
  520. zclLocationDataRsp_t loc; // the Location Data Response command (applicable to Data Response/Notification)
  521. zclLocationDevCfgRsp_t devCfg; // the Device Configuration Response command (only applicable to
  522. // COMMAND_LOCATION_DEV_CFG_RSP)
  523. uint8 locationType; // location type (only applicable to COMMAND_LOCATION_RSSI_PING)
  524. } un;
  525. } zclLocationRsp_t;
  526. // This callback is called to process an incoming Reset to Factory Defaults
  527. // command. On receipt of this command, the device resets all the attributes
  528. // of all its clusters to their factory defaults.
  529. typedef void (*zclGCB_BasicReset_t)( void );
  530. // This callback is called to process an incoming Identify command.
  531. // srcAddr - requestor's address
  532. // identifyTime - number of seconds the device will continue to identify itself
  533. typedef void (*zclGCB_Identify_t)( zclIdentify_t *pCmd );
  534. // This callback is called to process an incoming Identify Query Response command.
  535. // srcAddr - requestor's address
  536. // timeout - number of seconds the device will continue to identify itself
  537. typedef void (*zclGCB_IdentifyQueryRsp_t)( zclIdentifyQueryRsp_t *pRsp );
  538. // This callback is called to process an incoming On, Off or Toggle command.
  539. // cmd - received command, which will be either COMMAND_ON, COMMAND_OFF
  540. // or COMMAND_TOGGLE.
  541. typedef void (*zclGCB_OnOff_t)( uint8 cmd );
  542. // This callback is called to process a Level Control - Move to Level command
  543. // level - new level to move to
  544. // tansitionTime - time to take to move to the new level (in seconds)
  545. // withOnOff - with On/off command
  546. typedef void (*zclGCB_LevelControlMoveToLevel_t)( zclLCMoveToLevel_t *pCmd );
  547. // This callback is called to process a Level Control - Move command
  548. // moveMode - move mode which is either LEVEL_MOVE_STOP, LEVEL_MOVE_UP,
  549. // LEVEL_MOVE_ON_AND_UP, LEVEL_MOVE_DOWN, or LEVEL_MOVE_DOWN_AND_OFF
  550. // rate - rate of movement in steps per second.
  551. // withOnOff - with On/off command
  552. typedef void (*zclGCB_LevelControlMove_t)( zclLCMove_t *pCmd );
  553. // This callback is called to process a Level Control - Step command
  554. // stepMode - step mode which is either LEVEL_STEP_UP, LEVEL_STEP_ON_AND_UP,
  555. // LEVEL_STEP_DOWN, or LEVEL_STEP_DOWN_AND_OFF
  556. // amount - number of levels to step
  557. // transitionTime - time, in 1/10ths of a second, to take to perform the step
  558. // withOnOff - with On/off command
  559. typedef void (*zclGCB_LevelControlStep_t)( zclLCStep_t *pCmd );
  560. // This callback is called to process a Level Control - Stop command
  561. typedef void (*zclGCB_LevelControlStop_t)( void );
  562. // This callback is called to process an received Group Response message.
  563. // This means that this app sent the request message.
  564. // srcAddr - requestor's address
  565. // cmdID - which group message - COMMAND_GROUP_ADD_RSP, COMMAND_GROUP_VIEW_RSP,
  566. // COMMAND_GROUP_REMOVE_RSP or COMMAND_GROUP_GET_MEMBERSHIP_RSP
  567. // status - GROUP_STATUS_SUCCESS, GROUP_STATUS_TABLE_FULL,
  568. // GROUP_STATUS_ALREADY_IN_TABLE, or GROUP_STATUS_NOT_IN_TABLE. Not
  569. // valid for COMMAND_GROUP_GET_MEMBERSHIP_RSP
  570. // grpCnt - number of groups contained in group list
  571. // grpList - what group IDs the action was performed on
  572. // capacity - remaining capacity of group table
  573. // grpName - only valid for COMMAND_GROUP_VIEW_RSP
  574. typedef void (*zclGCB_GroupRsp_t)( zclGroupRsp_t *pRsp );
  575. // This callback is called to process an incoming Scene Store request.
  576. // The app will fill in the "extField" with what is needed to restore its
  577. // current settings.
  578. // srcAddr - requestor's address
  579. // scene - pointer to the scene structure
  580. // returns TRUE if extField is filled in, FALSE if not used.
  581. typedef uint8 (*zclGCB_SceneStoreReq_t)( zclSceneReq_t *pReq );
  582. // This callback is called to process an incoming Scene Recall request
  583. // The app will use what's in the "extField" to restore to these settings.
  584. // srcAddr - requestor's address
  585. // scene - pointer to the scene structure
  586. typedef void (*zclGCB_SceneRecallReq_t)( zclSceneReq_t *pReq );
  587. // This callback is called to process an incoming Scene responses. This means
  588. // that this app sent the request for this response.
  589. // srcAddr - requestor's address
  590. // cmdID - which response - COMMAND_SCENE_ADD_RSP, COMMAND_SCENE_VIEW_RSP,
  591. // COMMAND_SCENE_REMOVE_RSP, COMMAND_SCENE_REMOVE_ALL_RSP,
  592. // COMMAND_SCENE_STORE_RSP or COMMAND_SCENE_GET_MEMBERSHIPSHIP_RSP
  593. // status - response status
  594. // sceneCnt - number of scenes in the scene list (only valid for
  595. // COMMAND_SCENE_GET_MEMBERSHIPSHIP_RSP)
  596. // sceneList - list of scene IDs (only valid for COMMAND_SCENE_GET_MEMBERSHIPSHIP_RSP)
  597. // capacity - remaining capacity of the scene table (only valid for
  598. // COMMAND_SCENE_GET_MEMBERSHIPSHIP_RSP)
  599. // scene - pointer to the scene structure
  600. typedef void (*zclGCB_SceneRsp_t)( zclSceneRsp_t *pRsp );
  601. // This callback is called to process an incoming Alarm request or response command.
  602. // srcAddr - requestor's address
  603. // cmdID - COMMAND_ALARMS_ALARM or COMMAND_ALARMS_GET_RSP
  604. // status - response status (only applicable to COMMAND_ALARMS_GET_RSP)
  605. // alarmCode - identifying code for the cause of the alarm
  606. // clusterID - the id of the cluster whose attribute generated this alarm
  607. // timeStamp - the time at which the alarm occurred (only applicable to
  608. // COMMAND_ALARMS_GET_RSP)
  609. typedef void (*zclGCB_Alarm_t)( zclAlarm_t *pAlarm );
  610. // This callback is called to to process an incoming RSSI Location command.
  611. // srcAddr - requestor's address
  612. // cmdID - COMMAND_LOCATION_SET_ABSOLUTE, COMMAND_LOCATION_SET_DEV_CFG,
  613. // COMMAND_LOCATION_GET_DEV_CFG or COMMAND_LOCATION_GET_DATA
  614. // absLoc - Absolute Location info (only valid for COMMAND_LOCATION_SET_ABSOLUTE)
  615. // loc - Get Location info (only valid for COMMAND_LOCATION_GET_DATA)
  616. // devCfg - Device Config info (only valid for COMMAND_LOCATION_SET_DEV_CFG)
  617. // ieeeAddr - Device's IEEE Addr (only valid for COMMAND_LOCATION_GET_DEV_CFG)
  618. // seqNum - Sequence number received with the message (only valid for GET commands)
  619. typedef void (*zclGCB_Location_t)( zclLocation_t *pCmd );
  620. // This callback is called to process an incoming RSSI Location response command.
  621. // This means that this app sent the request for this response.
  622. // srcAddr - requestor's address
  623. // cmdID - COMMAND_LOCATION_DEV_CFG_RSP, COMMAND_LOCATION_DATA_RSP,
  624. // COMMAND_LOCATION_DATA_NOTIF, COMMAND_LOCATION_COMPACT_DATA_NOTIF
  625. // or COMMAND_LOCATION_RSSI_PING
  626. // locRsp - the Location Data Response command (applicable to Data Response/Notification)
  627. // devCfgRsp - the Device Configuration Response command (only applicable to
  628. // COMMAND_LOCATION_DEV_CFG_RSP)
  629. // locationType - location type (only applicable to COMMAND_LOCATION_RSSI_PING)
  630. typedef void (*zclGCB_LocationRsp_t)( zclLocationRsp_t *pRsp );
  631. // Register Callbacks table entry - enter function pointers for callbacks that
  632. // the application would like to receive
  633. typedef struct
  634. {
  635. zclGCB_BasicReset_t pfnBasicReset; // Basic Cluster Reset command
  636. zclGCB_Identify_t pfnIdentify; // Identify command
  637. zclGCB_IdentifyQueryRsp_t pfnIdentifyQueryRsp; // Identify Query Response command
  638. zclGCB_OnOff_t pfnOnOff; // On/Off cluster commands
  639. zclGCB_LevelControlMoveToLevel_t pfnLevelControlMoveToLevel; // Level Control Move to Level command
  640. zclGCB_LevelControlMove_t pfnLevelControlMove; // Level Control Move command
  641. zclGCB_LevelControlStep_t pfnLevelControlStep; // Level Control Step command
  642. zclGCB_LevelControlStop_t pfnLevelControlStop; // Level Control Stop command
  643. zclGCB_GroupRsp_t pfnGroupRsp; // Group Response commands
  644. zclGCB_SceneStoreReq_t pfnSceneStoreReq; // Scene Store Request command
  645. zclGCB_SceneRecallReq_t pfnSceneRecallReq; // Scene Recall Request command
  646. zclGCB_SceneRsp_t pfnSceneRsp; // Scene Response command
  647. zclGCB_Alarm_t pfnAlarm; // Alarm (Response) commands
  648. zclGCB_Location_t pfnLocation; // RSSI Location command
  649. zclGCB_LocationRsp_t pfnLocationRsp; // RSSI Location Response command
  650. } zclGeneral_AppCallbacks_t;
  651. /*********************************************************************
  652. * FUNCTION MACROS
  653. */
  654. #ifdef ZCL_BASIC
  655. /*
  656. * Send a Reset to Factory Defaults Command - COMMAND_BASIC_RESET_FACTORY_DEFAULTS
  657. * Use like:
  658. * ZStatus_t zclGeneral_SendBasicResetFactoryDefaults( uint16 srcEP, afAddrType_t *dstAddr, uint8 disableDefaultRsp, uint8 seqNum );
  659. */
  660. #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 )
  661. #endif // ZCL_BASIC
  662. #ifdef ZCL_IDENTIFY
  663. /*
  664. * Send a Identify Query command
  665. * Use like:
  666. * ZStatus_t zclGeneral_SendIdentifyQuery( uint8 srcEP, afAddrType_t *dstAddr, uint8 disableDefaultRsp, uint8 seqNum );
  667. */
  668. #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 )
  669. #endif // ZCL_IDENTIFY
  670. #ifdef ZCL_GROUPS
  671. /*
  672. * Send a Group Add Command
  673. * Use like:
  674. * ZStatus_t zclGeneral_SendGroupAdd( uint8 srcEP, afAddrType_t *dstAddr, uint16 groupID, uint8 *groupName, uint8 disableDefaultRsp, uint8 seqNum );
  675. */
  676. #define zclGeneral_SendGroupAdd(a,b,c,d,e,f) zclGeneral_SendAddGroupRequest( (a), (b), COMMAND_GROUP_ADD, (c), (d), (e), (f) )
  677. /*
  678. * Send a Group View Command
  679. * Use like:
  680. * ZStatus_t zclGeneral_SendGroupView( uint8 srcEP, afAddrType_t *dstAddr, uint16 groupID, uint8 disableDefaultRsp, uint8 seqNum );
  681. */
  682. #define zclGeneral_SendGroupView(a,b,c,d,e) zclGeneral_SendGroupRequest( (a), (b), COMMAND_GROUP_VIEW, (c), (d), (e) )
  683. /*
  684. * Send a Group Get Membership Command
  685. * Use like:
  686. * ZStatus_t zclGeneral_SendGroupGetMembership( uint8 srcEP, afAddrType_t *dstAddr, uint8 grpCnt, uint16 *grpList, uint8 disableDefaultRsp, uint8 seqNum );
  687. */
  688. #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) )
  689. /*
  690. * Send a Group Remove Command
  691. * Use like:
  692. * ZStatus_t zclGeneral_SendGroupRemove( uint8 srcEP, afAddrType_t *dstAddr, uint16 groupID, uint8 disableDefaultRsp, uint8 seqNum );
  693. */
  694. #define zclGeneral_SendGroupRemove(a,b,c,d,e) zclGeneral_SendGroupRequest( (a), (b), COMMAND_GROUP_REMOVE, (c), (d), (e) )
  695. /*
  696. * Send a Group Remove ALL Command - COMMAND_GROUP_REMOVE_ALL
  697. * Use like:
  698. * ZStatus_t zclGeneral_SendGroupRemoveAll( uint16 srcEP, afAddrType_t *dstAddr, uint8 disableDefaultRsp, uint8 seqNum );
  699. */
  700. #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 )
  701. /*
  702. * Send a Group Add If Identifying Command
  703. * Use like:
  704. * ZStatus_t zclGeneral_SendGroupAddIfIdentifying( uint8 srcEP, afAddrType_t *dstAddr, uint16 groupID, uint8 *groupName, uint8 disableDefaultRsp, uint8 seqNum );
  705. */
  706. #define zclGeneral_SendGroupAddIfIdentifying(a,b,c,d,e,f) zclGeneral_SendAddGroupRequest( (a), (b), COMMAND_GROUP_ADD_IF_IDENTIFYING, (c), (d), (e), (f) )
  707. /*
  708. * Send a Group Add Response Command
  709. * Use like:
  710. * ZStatus_t zclGeneral_SendGroupAddResponse( uint8 srcEP, afAddrType_t *dstAddr, uint8 status, uint16 groupID, uint8 disableDefaultRsp, uint8 seqNum );
  711. */
  712. #define zclGeneral_SendGroupAddResponse(a,b,c,d,e,f) zclGeneral_SendGroupResponse( (a), (b), COMMAND_GROUP_ADD_RSP, (c), (d), (e), (f) )
  713. /*
  714. * Send a Group Get Membership Response Command
  715. * Use like:
  716. * ZStatus_t zclGeneral_SendGroupGetMembershipResponse( uint8 srcEP, afAddrType_t *dstAddr, uint8 capacity, uint8 grpCnt, uint16 *grpList, uint8 disableDefaultRsp, uint8 seqNum );
  717. */
  718. #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) )
  719. /*
  720. * Send a Group Remove Response Command
  721. * Use like:
  722. * ZStatus_t zclGeneral_SendGroupRemoveResponse( uint8 srcEP, afAddrType_t *dstAddr, uint8 status, uint16 groupID, uint8 disableDefaultRsp, uint8 seqNum );
  723. */
  724. #define zclGeneral_SendGroupRemoveResponse(a,b,c,d,e,f) zclGeneral_SendGroupResponse( (a), (b), COMMAND_GROUP_REMOVE_RSP, (c), (d), (e), (f) )
  725. #endif // ZCL_GROUPS
  726. #ifdef ZCL_SCENES
  727. /*
  728. * Send a Scene View Command
  729. * Use like:
  730. * ZStatus_t zclGeneral_SendSceneView( uint8 srcEP, afAddrType_t *dstAddr, uint16 groupID, uint8 sceneID, uint8 disableDefaultRsp, uint8 seqNum );
  731. */
  732. #define zclGeneral_SendSceneView(a,b,c,d,e,f) zclGeneral_SendSceneRequest( (a), (b), COMMAND_SCENE_VIEW, (c), (d), (e), (f) )
  733. /*
  734. * Send a Scene Remove Command
  735. * Use like:
  736. * ZStatus_t zclGeneral_SendSceneRemove( uint8 srcEP, afAddrType_t *dstAddr, uint16 groupID, uint8 sceneID, uint8 disableDefaultRsp, uint8 seqNum );
  737. */
  738. #define zclGeneral_SendSceneRemove(a,b,c,d,e,f) zclGeneral_SendSceneRequest( (a), (b), COMMAND_SCENE_REMOVE, (c), (d), (e), (f) )
  739. /*
  740. * Send a Scene Store Command
  741. * Use like:
  742. * ZStatus_t zclGeneral_SendSceneStore( uint8 srcEP, afAddrType_t *dstAddr, uint16 groupID, uint8 sceneID, uint8 disableDefaultRsp, uint8 seqNum );
  743. */
  744. #define zclGeneral_SendSceneStore(a,b,c,d,e,f) zclGeneral_SendSceneRequest( (a), (b), COMMAND_SCENE_STORE, (c), (d), (e), (f) )
  745. /*
  746. * Send a Scene Recall Command
  747. * Use like:
  748. * ZStatus_t zclGeneral_SendSceneRecall( uint8 srcEP, afAddrType_t *dstAddr, uint16 groupID, uint8 sceneID, uint8 disableDefaultRsp, uint8 seqNum );
  749. */
  750. #define zclGeneral_SendSceneRecall(a,b,c,d,e,f) zclGeneral_SendSceneRequest( (a), (b), COMMAND_SCENE_RECALL, (c), (d), (e), (f) )
  751. /*
  752. * Send a Scene Remove ALL Command - COMMAND_SCENE_REMOVE_ALL
  753. * Use like:
  754. * ZStatus_t zclGeneral_SendSceneRemoveAll( uint16 srcEP, afAddrType_t *dstAddr, uint16 groupID, uint8 disableDefaultRsp, uint8 seqNum );
  755. */
  756. #define zclGeneral_SendSceneRemoveAll(a,b,c,d,e) zclGeneral_SendSceneRequest( (a), (b), COMMAND_SCENE_REMOVE_ALL, (c), 0, (d), (e) )
  757. /*
  758. * Send a Scene Get Membership Command - COMMAND_SCENE_GET_MEMBERSHIPSHIP
  759. * Use like:
  760. * ZStatus_t zclGeneral_SendSceneGetMembership( uint16 srcEP, afAddrType_t *dstAddr, uint16 groupID, uint8 disableDefaultRsp, uint8 seqNum );
  761. */
  762. #define zclGeneral_SendSceneGetMembership(a,b,c,d,e) zclGeneral_SendSceneRequest( (a), (b), COMMAND_SCENE_GET_MEMBERSHIP, (c), 0, (d), (e) )
  763. /*
  764. * Send a Scene Remove ALL Response Command - COMMAND_SCENE_ADD_RSP
  765. * Use like:
  766. * ZStatus_t zclGeneral_SendSceneAddResponse( uint16 srcEP, afAddrType_t *dstAddr, uint8 status, uint16 groupID, uint8 sceneID, uint8 disableDefaultRsp, uint8 seqNum );
  767. */
  768. #define zclGeneral_SendSceneAddResponse(a,b,c,d,e,f,g) zclGeneral_SendSceneResponse( (a), (b), COMMAND_SCENE_ADD_RSP, (c), (d), (e), (f), (g) )
  769. /*
  770. * Send a Scene Remove Response Command - COMMAND_SCENE_REMOVE_RSP
  771. * Use like:
  772. * ZStatus_t zclGeneral_SendSceneRemoveResponse( uint16 srcEP, afAddrType_t *dstAddr, uint8 status, uint16 groupID, uint8 sceneID, uint8 disableDefaultRsp, uint8 seqNum );
  773. */
  774. #define zclGeneral_SendSceneRemoveResponse(a,b,c,d,e,f,g) zclGeneral_SendSceneResponse( (a), (b), COMMAND_SCENE_REMOVE_RSP, (c), (d), (e), (f), (g) )
  775. /*
  776. * Send a Scene Remove All Response Command - COMMAND_SCENE_REMOVE_ALL_RSP
  777. * Use like:
  778. * ZStatus_t zclGeneral_SendSceneRemoveAllResponse( uint16 srcEP, afAddrType_t *dstAddr, uint8 status, uint16 groupID, uint8 disableDefaultRsp, uint8 seqNum );
  779. */
  780. #define zclGeneral_SendSceneRemoveAllResponse(a,b,c,d,e,f) zclGeneral_SendSceneResponse( (a), (b), COMMAND_SCENE_REMOVE_ALL_RSP, (c), (d), 0, (e), (f) )
  781. /*
  782. * Send a Scene Remove ALL Response Command - COMMAND_SCENE_STORE_RSP
  783. * Use like:
  784. * ZStatus_t zclGeneral_SendSceneStoreResponse( uint16 srcEP, afAddrType_t *dstAddr, uint8 status, uint16 groupID, uint8 sceneID, uint8 disableDefaultRsp, uint8 seqNum );
  785. */
  786. #define zclGeneral_SendSceneStoreResponse(a,b,c,d,e,f,g) zclGeneral_SendSceneResponse( (a), (b), COMMAND_SCENE_STORE_RSP, (c), (d), (e), (f), (g) )
  787. #endif // ZCL_SCENES
  788. #ifdef ZCL_ON_OFF
  789. /*
  790. * Send an On Off Command - COMMAND_ONOFF_OFF
  791. * Use like:
  792. * ZStatus_t zclGeneral_SendOnOff_CmdOff( uint16 srcEP, afAddrType_t *dstAddr, uint8 disableDefaultRsp, uint8 seqNum );
  793. */
  794. #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 )
  795. /*
  796. * Send an On Off Command - COMMAND_ONOFF_ON
  797. * Use like:
  798. * ZStatus_t zclGeneral_SendOnOff_CmdOn( uint16 srcEP, afAddrType_t *dstAddr, uint8 disableDefaultRsp, uint8 seqNum );
  799. */
  800. #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 )
  801. /*
  802. * Send an On Off Command - COMMAND_ONOFF_TOGGLE
  803. * Use like:
  804. * ZStatus_t zclGeneral_SendOnOff_CmdToggle( uint16 srcEP, afAddrType_t *dstAddr, uint8 disableDefaultRsp, uint8 seqNum );
  805. */
  806. #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 )
  807. #endif // ZCL_ON_OFF
  808. #ifdef ZCL_LEVEL_CTRL
  809. /*
  810. * Send a Level Control Move to Level Command - COMMAND_LEVEL_MOVE_TO_LEVEL
  811. * Use like:
  812. * ZStatus_t zclGeneral_SendLevelControlMoveToLevel( uint16 srcEP, afAddrType_t *dstAddr, uint8 level, uint16 transTime, uint8 disableDefaultRsp, uint8 seqNum );
  813. */
  814. #define zclGeneral_SendLevelControlMoveToLevel(a,b,c,d,e,f) zclGeneral_SendLevelControlMoveToLevelRequest( (a), (b), COMMAND_LEVEL_MOVE_TO_LEVEL, (c), (d), (e) ,(f) )
  815. /*
  816. * Send a Level Control Move Command - COMMAND_LEVEL_MOVE
  817. * Use like:
  818. * ZStatus_t zclGeneral_SendLevelControlMoveRequest( uint8 srcEP, afAddrType_t *dstAddr, uint8 moveMode, uint8 rate, uint8 disableDefaultRsp, uint8 seqNum )
  819. */
  820. #define zclGeneral_SendLevelControlMove(a,b,c,d,e,f) zclGeneral_SendLevelControlMoveRequest( (a), (b), COMMAND_LEVEL_MOVE, (c), (d), (e), (f) )
  821. /*
  822. * Send out a Level Control Step Command - COMMAND_LEVEL_STEP
  823. * Use like:
  824. * ZStatus_t zclGeneral_SendLevelControlStep( uint8 srcEP, afAddrType_t *dstAddr, uint8 stepMode, uint8 stepSize, uint16 transTime, uint8 disableDefaultRsp, uint8 seqNum );
  825. */
  826. #define zclGeneral_SendLevelControlStep(a,b,c,d,e,f,g) zclGeneral_SendLevelControlStepRequest( (a), (b), COMMAND_LEVEL_STEP, (c), (d), (e), (f), (g) )
  827. /*
  828. * Send out a Level Control Stop Command - COMMAND_LEVEL_STOP
  829. * Use like:
  830. * ZStatus_t zclGeneral_SendLevelControlStop( uint8 srcEP, afAddrType_t *dstAddr, uint8 disableDefaultRsp, uint8 seqNum );
  831. */
  832. #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 )
  833. /*
  834. * Send a Level Control Move to Level with On/Off Command - COMMAND_LEVEL_MOVE_TO_LEVEL_WITH_ON_OFF
  835. * Use like:
  836. * ZStatus_t zclGeneral_SendLevelControlMoveToLevelWithOnOff( uint16 srcEP, afAddrType_t *dstAddr, uint8 level, uint16 transTime, uint8 disableDefaultRsp, uint8 seqNum );
  837. */
  838. #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) )
  839. /*
  840. * Send a Level Control Move with On/Off Command - COMMAND_LEVEL_MOVE_WITH_ON_OFF
  841. * Use like:
  842. * ZStatus_t zclGeneral_SendLevelControlMoveWithOnOff( uint8 srcEP, afAddrType_t *dstAddr, uint8 moveMode, uint8 rate, uint8 disableDefaultRsp, uint8 seqNum )
  843. */
  844. #define zclGeneral_SendLevelControlMoveWithOnOff(a,b,c,d,e,f) zclGeneral_SendLevelControlMoveRequest( (a), (b), COMMAND_LEVEL_MOVE_WITH_ON_OFF, (c), (d), (e), (f) )
  845. /*
  846. * Send out a Level Control Step with On/Off Command - COMMAND_LEVEL_STEP_WITH_ON_OFF
  847. * Use like:
  848. * ZStatus_t zclGeneral_SendLevelControlStepWithOnOff( uint8 srcEP, afAddrType_t *dstAddr, uint8 stepMode, uint8 stepSize, uint16 transTime, uint8 disableDefaultRsp, uint8 seqNum );
  849. */
  850. #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) )
  851. /*
  852. * Send out a Level Control Stop with On/Off Command - COMMAND_LEVEL_STOP_WITH_ON_OFF
  853. * Use like:
  854. * ZStatus_t zclGeneral_SendLevelControlStopWithOnOff( uint8 srcEP, afAddrType_t *dstAddr, uint8 disableDefaultRsp, uint8 seqNum );
  855. */
  856. #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 )
  857. #endif // ZCL_LEVEL_CTRL
  858. #ifdef ZCL_ALARMS
  859. /*
  860. * Send an Alarm Reset Command - COMMAND_ALARMS_RESET
  861. * Use like:
  862. * ZStatus_t zclGeneral_SendAlarmReset( uint16 srcEP, afAddrType_t *dstAddr, uint8 alarmCode, uint16 clusterID, uint8 disableDefaultRsp, uint8 seqNum );
  863. */
  864. #define zclGeneral_SendAlarmReset(a,b,c,d,e,f) zclGeneral_SendAlarmRequest( (a), (b), COMMAND_ALARMS_RESET, (c), (d), (e), (f) )
  865. /*
  866. * Send an Alarm Reset ALL Command - COMMAND_ALARMS_RESET_ALL
  867. * Use like:
  868. * ZStatus_t zclGeneral_SendAlarmResetAll( uint16 srcEP, afAddrType_t *dstAddr, uint8 disableDefaultRsp, uint8 seqNum );
  869. */
  870. #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 )
  871. /*
  872. * Send an Alarm Get Command - COMMAND_ALARMS_GET
  873. * Use like:
  874. * ZStatus_t zclGeneral_SendAlarmGet uint16 srcEP, afAddrType_t *dstAddr, uint8 disableDefaultRsp, uint8 seqNum );
  875. */
  876. #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 )
  877. /*
  878. * Send an Alarm Reset Log Command - COMMAND_ALARMS_RESET_LOG
  879. * Use like:
  880. * ZStatus_t zclGeneral_SendAlarmResetLog( uint16 srcEP, afAddrType_t *dstAddr, uint8 disableDefaultRsp, uint8 seqNum );
  881. */
  882. #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 )
  883. /*
  884. * Send an Alarm Command - COMMAND_ALARMS_ALARM
  885. * Use like:
  886. * ZStatus_t zclGeneral_SendAlarm( uint16 srcEP, afAddrType_t *dstAddr, uint8 alarmCode, uint16 clusterID, uint8 disableDefaultRsp, uint8 seqNum );
  887. */
  888. #define zclGeneral_SendAlarm(a,b,c,d,e,f) zclGeneral_SendAlarmRequest( (a), (b), COMMAND_ALARMS_ALARM, (c), (d), (e), (f) )
  889. #endif // ZCL_ALARMS
  890. #ifdef ZCL_LOCATION
  891. /*
  892. * Send a Location Data Response Command - COMMAND_LOCATION_DATA_RSP
  893. * Use like:
  894. * ZStatus_t zclGeneral_SendLocationDataResponse( uint16 srcEP, afAddrType_t *dstAddr, zclLocationDataRsp_t *locData, uint8 disableDefaultRsp, uint8 seqNum );
  895. */
  896. #define zclGeneral_SendLocationDataResponse(a,b,c,d,e) zclGeneral_SendLocationData( (a), (b), COMMAND_LOCATION_DATA_RSP, ((c)->status), (&((c)->data)), (d), (e) )
  897. /*
  898. * Send a Location Data Notification Command - COMMAND_LOCATION_DATA_NOTIFICATION
  899. * Use like:
  900. * ZStatus_t zclGeneral_SendLocationDataNotif( uint16 srcEP, afAddrType_t *dstAddr, zclLocationData_t *locData, uint8 seqNum );
  901. */
  902. #define zclGeneral_SendLocationDataNotif(a,b,c,d) zclGeneral_SendLocationData( (a), (b), COMMAND_LOCATION_DATA_NOTIF, 0, (c), (d) )
  903. /*
  904. * Send a Location Data Compact Notification Command - COMMAND_LOCATION_COMPACT_DATA_NOTIFICATION
  905. * Use like:
  906. * ZStatus_t zclGeneral_SendLocationDataCompactNotif( uint16 srcEP, afAddrType_t *dstAddr, zclLocationData_t *locData, uint8 seqNum );
  907. */
  908. #define zclGeneral_SendLocationDataCompactNotif(a,b,c,d) zclGeneral_SendLocationData( (a), (b), COMMAND_LOCATION_DATA_COMPACT_NOTIF, 0, (c), (d) )
  909. /*
  910. * Send an RSSI Ping Command - COMMAND_LOCATION_RSSI_PING
  911. * Use like:
  912. * ZStatus_t zclGeneral_SendRSSIPing( uint16 srcEP, afAddrType_t *dstAddr, uint8 locationType, uint8 disableDefaultRsp, uint8 seqNum );
  913. */
  914. #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) )
  915. #endif // ZCL_LOCATION
  916. /*********************************************************************
  917. * FUNCTIONS
  918. */
  919. /*
  920. * Register for callbacks from this cluster library
  921. */
  922. extern ZStatus_t zclGeneral_RegisterCmdCallbacks( uint8 endpoint, zclGeneral_AppCallbacks_t *callbacks );
  923. #ifdef ZCL_LEVEL_CTRL
  924. /*
  925. * Call to send out a Level Control Move to Level Request
  926. * cmd - Move or Move with On/Off
  927. * level - what level to move to
  928. * transitionTime - how long to take to get to the level (in seconds).
  929. */
  930. extern ZStatus_t zclGeneral_SendLevelControlMoveToLevelRequest( uint8 srcEP, afAddrType_t *dstAddr,
  931. uint8 cmd, uint8 level, uint16 transTime,
  932. uint8 disableDefaultRsp, uint8 seqNum );
  933. /*
  934. * Call to send out a Level Control Move Request
  935. * cmd - Step or Step with On/Off
  936. * moveMode - LEVEL_MOVE_UP or
  937. * LEVEL_MOVE_DOWN
  938. * rate - number of steps to take per second
  939. */
  940. extern ZStatus_t zclGeneral_SendLevelControlMoveRequest( uint8 srcEP, afAddrType_t *dstAddr,
  941. uint8 cmd, uint8 moveMode, uint8 rate,
  942. uint8 disableDefaultRsp, uint8 seqNum );
  943. /*
  944. * Call to send out a Level Control Step Request
  945. * cmd - Step or Step with On/Off
  946. * stepMode - LEVEL_STEP_UP or
  947. * LEVEL_STEP_DOWN
  948. * amount - number of levels to step
  949. * transitionTime - time to take to perform a single step
  950. */
  951. extern ZStatus_t zclGeneral_SendLevelControlStepRequest( uint8 srcEP, afAddrType_t *dstAddr,
  952. uint8 cmd, uint8 stepMode, uint8 stepSize, uint16 transTime,
  953. uint8 disableDefaultRsp, uint8 seqNum );
  954. #endif // ZCL_LEVEL_CTRL
  955. #ifdef ZCL_GROUPS
  956. /*
  957. * Send Group Response (not Group View Response)
  958. * - Use MACROS instead:
  959. * zclGeneral_SendGroupAddResponse or zclGeneral_SendGroupRemoveResponse
  960. */
  961. extern ZStatus_t zclGeneral_SendGroupResponse( uint8 srcEP, afAddrType_t *dstAddr,
  962. uint8 cmd, uint8 status, uint16 groupID,
  963. uint8 disableDefaultRsp, uint8 seqNum );
  964. /*
  965. * Call to send Group Response Command
  966. */
  967. extern ZStatus_t zclGeneral_SendGroupViewResponse( uint8 srcEP, afAddrType_t *dstAddr,
  968. uint8 status, aps_Group_t *grp,
  969. uint8 disableDefaultRsp, uint8 seqNum );
  970. /*
  971. * Call to send Group Membership Command
  972. */
  973. extern ZStatus_t zclGeneral_SendGroupGetMembershipRequest( uint8 srcEP, afAddrType_t *dstAddr,
  974. uint8 cmd, uint8 rspCmd, uint8 direction, uint8 capacity,
  975. uint8 grpCnt, uint16 *grpList, uint8 disableDefaultRsp, uint8 seqNum );
  976. #endif // ZCL_GROUPS
  977. #ifdef ZCL_SCENES
  978. /*
  979. * Add a scene for an endpoint
  980. */
  981. extern ZStatus_t zclGeneral_AddScene( uint8 endpoint, zclGeneral_Scene_t *scene );
  982. /*
  983. * Find a scene with endpoint and sceneID
  984. */
  985. extern zclGeneral_Scene_t *zclGeneral_FindScene( uint8 endpoint, uint16 groupID, uint8 sceneID );
  986. /*
  987. * Get all the scenes with groupID
  988. */
  989. extern uint8 zclGeneral_FindAllScenesForGroup( uint8 endpoint, uint16 groupID, uint8 *sceneList );
  990. /*
  991. * Remove a scene with endpoint and sceneID
  992. */
  993. extern uint8 zclGeneral_RemoveScene( uint8 endpoint, uint16 groupID, uint8 sceneID );
  994. /*
  995. * Remove all scenes for an endpoint
  996. */
  997. extern void zclGeneral_RemoveAllScenes( uint8 endpoint, uint16 groupID );
  998. /*
  999. * Count the number of scenes for an endpoint
  1000. */
  1001. extern uint8 zclGeneral_CountScenes( uint8 endpoint );
  1002. /*
  1003. * Count the number of scenes
  1004. */
  1005. extern uint8 zclGeneral_CountAllScenes( void );
  1006. /*
  1007. * Add Scene Request message
  1008. */
  1009. extern ZStatus_t zclGeneral_SendAddScene( uint8 srcEP, afAddrType_t *dstAddr,
  1010. zclGeneral_Scene_t *scene,
  1011. uint8 disableDefaultRsp, uint8 seqNum );
  1012. /*
  1013. * Send a Scene command (request) - not Scene Add
  1014. */
  1015. extern ZStatus_t zclGeneral_SendSceneRequest( uint8 srcEP, afAddrType_t *dstAddr,
  1016. uint8 cmd, uint16 groupID, uint8 sceneID,
  1017. uint8 disableDefaultRsp, uint8 seqNum );
  1018. /*
  1019. * Send Scene response messages for either COMMAND_SCENE_ADD_RSP,
  1020. * COMMAND_SCENE_REMOVE_RSP or COMMAND_SCENE_STORE_RSP
  1021. */
  1022. extern ZStatus_t zclGeneral_SendSceneResponse( uint8 srcEP, afAddrType_t *dstAddr,
  1023. uint8 cmd, uint8 status, uint16 groupID,
  1024. uint8 sceneID, uint8 disableDefaultRsp, uint8 seqNum );
  1025. /*
  1026. * Send Scene View response message
  1027. */
  1028. extern ZStatus_t zclGeneral_SendSceneViewResponse( uint8 srcEP, afAddrType_t *dstAddr,
  1029. uint8 status, zclGeneral_Scene_t *scene,
  1030. uint8 disableDefaultRsp, uint8 seqNum );
  1031. /*
  1032. * Send Scene Get Membership response message
  1033. */
  1034. extern ZStatus_t zclGeneral_SendSceneGetMembershipResponse( uint8 srcEP, afAddrType_t *dstAddr,
  1035. uint8 sceneStatus, uint8 capacity, uint8 sceneCnt, uint8 *sceneList,
  1036. uint16 groupID, uint8 disableDefaultRsp, uint8 seqNum );
  1037. #endif // ZCL_SCENES
  1038. #ifdef ZCL_GROUPS
  1039. /*
  1040. * Send a Group command (request) - not Group Add or Remove All
  1041. */
  1042. extern ZStatus_t zclGeneral_SendGroupRequest( uint8 srcEP, afAddrType_t *dstAddr,
  1043. uint8 cmd, uint16 groupID,
  1044. uint8 disableDefaultRsp, uint8 seqNum );
  1045. /*
  1046. * Send a Group Add command (request)
  1047. * groupName - pointer to Group Name. This is a Zigbee
  1048. * string data type, so the first byte is the length of the
  1049. * name (in bytes), then the name.
  1050. */
  1051. extern ZStatus_t zclGeneral_SendAddGroupRequest( uint8 srcEP, afAddrType_t *dstAddr,
  1052. uint8 cmd, uint16 groupID, uint8 *groupName,
  1053. uint8 disableDefaultRsp, uint8 seqNum );
  1054. #endif // ZCL_GROUPS
  1055. #ifdef ZCL_IDENTIFY
  1056. /*
  1057. * Send a Identify message
  1058. */
  1059. extern ZStatus_t zclGeneral_SendIdentify( uint8 srcEP, afAddrType_t *dstAddr,
  1060. uint16 identifyTime, uint8 disableDefaultRsp, uint8 seqNum );
  1061. /*
  1062. * Send a Identify Query Response message
  1063. */
  1064. extern ZStatus_t zclGeneral_SendIdentifyQueryResponse( uint8 srcEP, afAddrType_t *dstAddr,
  1065. uint16 timeout, uint8 disableDefaultRsp, uint8 seqNum );
  1066. #endif // ZCL_IDENTIFY
  1067. #ifdef ZCL_ALARMS
  1068. /*
  1069. * Send out an Alarm Request Command
  1070. */
  1071. extern ZStatus_t zclGeneral_SendAlarmRequest( uint8 srcEP, afAddrType_t *dstAddr,
  1072. uint8 cmd, uint8 alarmCode, uint16 clusterID,
  1073. uint8 disableDefaultRsp, uint8 seqNum );
  1074. /*
  1075. * Send out an Alarm Get Response Command
  1076. */
  1077. extern ZStatus_t zclGeneral_SendAlarmGetRespnose( uint8 srcEP, afAddrType_t *dstAddr,
  1078. uint8 status, uint8 alarmCode, uint16 clusterID,
  1079. uint32 timeStamp, uint8 disableDefaultRsp, uint8 seqNum );
  1080. #endif // ZCL_ALARMS
  1081. #ifdef ZCL_LOCATION
  1082. /*
  1083. * Send a Set Absolute Location message
  1084. */
  1085. extern ZStatus_t zclGeneral_SendLocationSetAbsolute( uint8 srcEP, afAddrType_t *dstAddr,
  1086. zclLocationAbsolute_t *absLoc,
  1087. uint8 disableDefaultRsp, uint8 seqNum );
  1088. /*
  1089. * Send a Set Device Configuration message
  1090. */
  1091. extern ZStatus_t zclGeneral_SendLocationSetDevCfg( uint8 srcEP, afAddrType_t *dstAddr,
  1092. zclLocationDevCfg_t *devCfg,
  1093. uint8 disableDefaultRsp, uint8 seqNum );
  1094. /*
  1095. * Send a Get Device Configuration message
  1096. */
  1097. extern ZStatus_t zclGeneral_SendLocationGetDevCfg( uint8 srcEP, afAddrType_t *dstAddr,
  1098. uint8 *targetAddr, uint8 disableDefaultRsp, uint8 seqNum );
  1099. /*
  1100. * Send a Get Location Data message
  1101. */
  1102. extern ZStatus_t zclGeneral_SendLocationGetData( uint8 srcEP, afAddrType_t *dstAddr,
  1103. zclLocationGetData_t *locData,
  1104. uint8 disableDefaultRsp, uint8 seqNum );
  1105. /*
  1106. * Send a Set Device Configuration Response message
  1107. */
  1108. extern ZStatus_t zclGeneral_SendLocationDevCfgResponse( uint8 srcEP, afAddrType_t *dstAddr,
  1109. zclLocationDevCfgRsp_t *devCfg,
  1110. uint8 disableDefaultRsp, uint8 seqNum );
  1111. /*
  1112. * Send a Location Data Response, Location Data Notification or Compact Location
  1113. * Data Notification message.
  1114. */
  1115. extern ZStatus_t zclGeneral_SendLocationData( uint8 srcEP, afAddrType_t *dstAddr, uint8 cmd,
  1116. uint8 status, zclLocationData_t *locData,
  1117. uint8 disableDefaultRsp, uint8 seqNum );
  1118. #endif // ZCL_LOCATION
  1119. #ifdef ZCL_ALARMS
  1120. /*
  1121. * Add an alarm for a cluster
  1122. */
  1123. extern ZStatus_t zclGeneral_AddAlarm( uint8 endpoint, zclGeneral_Alarm_t *alarm );
  1124. /*
  1125. * Find an alarm with alarmCode and clusterID
  1126. */
  1127. extern zclGeneral_Alarm_t *zclGeneral_FindAlarm( uint8 endpoint, uint8 alarmCode, uint16 clusterID );
  1128. /*
  1129. * Find an alarm with the earliest timestamp
  1130. */
  1131. extern zclGeneral_Alarm_t *zclGeneral_FindEarliestAlarm( uint8 endpoint );
  1132. /*
  1133. * Remove a scene with endpoint and sceneID
  1134. */
  1135. extern void zclGeneral_ResetAlarm( uint8 endpoint, uint8 alarmCode, uint16 clusterID );
  1136. /*
  1137. * Remove all scenes with endpoint
  1138. */
  1139. extern void zclGeneral_ResetAllAlarms( uint8 endpoint, uint8 notifyApp );
  1140. #endif // ZCL_ALARMS
  1141. /*********************************************************************
  1142. *********************************************************************/
  1143. #ifdef __cplusplus
  1144. }
  1145. #endif
  1146. #endif /* ZCL_GENERAL_H */