zcl_lighting.h 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543
  1. /**************************************************************************************************
  2. Filename: zcl_lighting.h
  3. Revised: $Date: 2010-02-09 15:28:14 -0800 (Tue, 09 Feb 2010) $
  4. Revision: $Revision: 21679 $
  5. Description: This file contains the ZCL Lighting library definitions.
  6. Copyright 2006-2010 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_LIGHTING_H
  34. #define ZCL_LIGHTING_H
  35. #ifdef __cplusplus
  36. extern "C"
  37. {
  38. #endif
  39. /******************************************************************************
  40. * INCLUDES
  41. */
  42. #include "zcl.h"
  43. /******************************************************************************
  44. * CONSTANTS
  45. */
  46. /*****************************************/
  47. /*** Color Control Cluster Attributes ***/
  48. /*****************************************/
  49. // Color Information attributes set
  50. #define ATTRID_LIGHTING_COLOR_CONTROL_CURRENT_HUE 0x0000
  51. #define ATTRID_LIGHTING_COLOR_CONTROL_CURRENT_SATURATION 0x0001
  52. #define ATTRID_LIGHTING_COLOR_CONTROL_REMAINING_TIME 0x0002
  53. #define ATTRID_LIGHTING_COLOR_CONTROL_CURRENT_X 0x0003
  54. #define ATTRID_LIGHTING_COLOR_CONTROL_CURRENT_Y 0x0004
  55. #define ATTRID_LIGHTING_COLOR_CONTROL_DRIFT_COMPENSATION 0x0005
  56. #define ATTRID_LIGHTING_COLOR_CONTROL_COMPENSATION_TEXT 0x0006
  57. #define ATTRID_LIGHTING_COLOR_CONTROL_COLOR_TEMPERATURE 0x0007
  58. #define ATTRID_LIGHTING_COLOR_CONTROL_COLOR_MODE 0x0008
  59. // Defined Primaries Inofrmation attribute Set
  60. #define ATTRID_LIGHTING_COLOR_CONTROL_NUM_PRIMARIES 0x0010
  61. #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_1_X 0x0011
  62. #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_1_Y 0x0012
  63. #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_1_INTENSITY 0x0013
  64. // 0x0014 is reserved
  65. #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_2_X 0x0015
  66. #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_2_Y 0x0016
  67. #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_2_INTENSITY 0x0017
  68. // 0x0018 is reserved
  69. #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_3_X 0x0019
  70. #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_3_Y 0x001a
  71. #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_3_INTENSITY 0x001b
  72. // Additional Defined Primaries Information attribute set
  73. #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_4_X 0x0020
  74. #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_4_Y 0x0021
  75. #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_4_INTENSITY 0x0022
  76. // 0x0023 is reserved
  77. #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_5_X 0x0024
  78. #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_5_Y 0x0025
  79. #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_5_INTENSITY 0x0026
  80. // 0x0027 is reserved
  81. #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_6_X 0x0028
  82. #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_6_Y 0x0029
  83. #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_6_INTENSITY 0x002a
  84. // Defined Color Points Settings attribute set
  85. #define ATTRID_LIGHTING_COLOR_CONTROL_WHITE_POINT_X 0x0030
  86. #define ATTRID_LIGHTING_COLOR_CONTROL_WHITE_POINT_Y 0x0031
  87. #define ATTRID_LIGHTING_COLOR_CONTROL_COLOR_POINT_R_X 0x0032
  88. #define ATTRID_LIGHTING_COLOR_CONTROL_COLOR_POINT_R_Y 0x0033
  89. #define ATTRID_LIGHTING_COLOR_CONTROL_COLOR_POINT_R_INTENSITY 0x0034
  90. // 0x0035 is reserved
  91. #define ATTRID_LIGHTING_COLOR_CONTROL_COLOR_POINT_G_X 0x0036
  92. #define ATTRID_LIGHTING_COLOR_CONTROL_COLOR_POINT_G_Y 0x0037
  93. #define ATTRID_LIGHTING_COLOR_CONTROL_COLOR_POINT_B_INTENSITY 0x0038
  94. // 0x0039 is reserved
  95. #define ATTRID_LIGHTING_COLOR_CONTROL_COLOR_POINT_B_X 0x003a
  96. #define ATTRID_LIGHTING_COLOR_CONTROL_COLOR_POINT_B_Y 0x003b
  97. #define ATTRID_LIGHTING_COLOR_CONTROL_COLOR_POINT_G_INTENSITY 0x003c
  98. // 0x003d is reserved
  99. /*** Drift Compensation Attribute values ***/
  100. #define DRIFT_COMP_NONE 0x00
  101. #define DRIFT_COMP_OTHER_UNKNOWN 0x01
  102. #define DRIFT_COMP_TEMPERATURE_MONITOR 0x02
  103. #define DRIFT_COMP_OPTICAL_LUMINANCE_MONITOR_FEEDBACK 0x03
  104. #define DRIFT_COMP_OPTICAL_COLOR_MONITOR_FEEDBACK 0x04
  105. /*** Color Mode Attribute values ***/
  106. #define COLOR_MODE_CURRENT_HUE_SATURATION 0x00
  107. #define COLOR_MODE_CURRENT_X_Y 0x01
  108. #define COLOR_MODE_COLOR_TEMPERATURE 0x02
  109. /*****************************************/
  110. /*** Color Control Cluster Commands ***/
  111. /*****************************************/
  112. #define COMMAND_LIGHTING_MOVE_TO_HUE 0x00
  113. #define COMMAND_LIGHTING_MOVE_HUE 0x01
  114. #define COMMAND_LIGHTING_STEP_HUE 0x02
  115. #define COMMAND_LIGHTING_MOVE_TO_SATURATION 0x03
  116. #define COMMAND_LIGHTING_MOVE_SATURATION 0x04
  117. #define COMMAND_LIGHTING_STEP_SATURATION 0x05
  118. #define COMMAND_LIGHTING_MOVE_TO_HUE_AND_SATURATION 0x06
  119. #define COMMAND_LIGHTING_MOVE_TO_COLOR 0x07
  120. #define COMMAND_LIGHTING_MOVE_COLOR 0x08
  121. #define COMMAND_LIGHTING_STEP_COLOR 0x09
  122. #define COMMAND_LIGHTING_MOVE_TO_COLOR_TEMPERATURE 0x0a
  123. /*** Move To Hue Cmd payload: direction field values ***/
  124. #define LIGHTING_MOVE_TO_HUE_DIRECTION_SHORTEST_DISTANCE 0x00
  125. #define LIGHTING_MOVE_TO_HUE_DIRECTION_LONGEST_DISTANCE 0x01
  126. #define LIGHTING_MOVE_TO_HUE_DIRECTION_UP 0x02
  127. #define LIGHTING_MOVE_TO_HUE_DIRECTION_DOWN 0x03
  128. /*** Move Hue Cmd payload: moveMode field values ***/
  129. #define LIGHTING_MOVE_HUE_STOP 0x00
  130. #define LIGHTING_MOVE_HUE_UP 0x01
  131. #define LIGHTING_MOVE_HUE_DOWN 0x03
  132. /*** Step Hue Cmd payload: stepMode field values ***/
  133. #define LIGHTING_STEP_HUE_UP 0x01
  134. #define LIGHTING_STEP_HUE_DOWN 0x03
  135. /*** Move Saturation Cmd payload: moveMode field values ***/
  136. #define LIGHTING_MOVE_SATURATION_STOP 0x00
  137. #define LIGHTING_MOVE_SATURATION_UP 0x01
  138. #define LIGHTING_MOVE_SATURATION_DOWN 0x03
  139. /*** Step Saturation Cmd payload: stepMode field values ***/
  140. #define LIGHTING_STEP_SATURATION_UP 0x01
  141. #define LIGHTING_STEP_SATURATION_DOWN 0x03
  142. /*****************************************************************************/
  143. /*** Ballast Configuration Cluster Attributes ***/
  144. /*****************************************************************************/
  145. // Ballast Information attribute set
  146. #define ATTRID_LIGHTING_BALLAST_CONFIG_PHYSICAL_MIN_LEVEL 0x0000
  147. #define ATTRID_LIGHTING_BALLAST_CONFIG_PHYSICAL_MAX_LEVEL 0x0001
  148. #define ATTRID_LIGHTING_BALLAST_BALLAST_STATUS 0x0002
  149. /*** Ballast Status Attribute values (by bit number) ***/
  150. #define LIGHTING_BALLAST_STATUS_NON_OPERATIONAL 1 // bit 0 is set
  151. #define LIGHTING_BALLAST_STATUS_LAMP_IS_NOT_IN_SOCKET 2 // bit 1 is set
  152. // Ballast Settings attributes set
  153. #define ATTRID_LIGHTING_BALLAST_MIN_LEVEL 0x0010
  154. #define ATTRID_LIGHTING_BALLAST_MAX_LEVEL 0x0011
  155. #define ATTRID_LIGHTING_BALLAST_POWER_ON_LEVEL 0x0012
  156. #define ATTRID_LIGHTING_BALLAST_POWER_ON_FADE_TIME 0x0013
  157. #define ATTRID_LIGHTING_BALLAST_INTRISTIC_BALLAST_FACTOR 0x0014
  158. #define ATTRID_LIGHTING_BALLAST_BALLAST_FACTOR_ADJUSTMENT 0x0015
  159. // Lamp Information attributes set
  160. #define ATTRID_LIGHTING_BALLAST_LAMP_QUANTITY 0x0020
  161. // Lamp Settings attributes set
  162. #define ATTRID_LIGHTING_BALLAST_LAMP_TYPE 0x0030
  163. #define ATTRID_LIGHTING_BALLAST_LAMP_MANUFACTURER 0x0031
  164. #define ATTRID_LIGHTING_BALLAST_LAMP_RATED_HOURS 0x0032
  165. #define ATTRID_LIGHTING_BALLAST_LAMP_BURN_HOURS 0x0033
  166. #define ATTRID_LIGHTING_BALLAST_LAMP_ALARM_MODE 0x0034
  167. #define ATTRID_LIGHTING_BALLAST_LAMP_BURN_HOURS_TRIP_POINT 0x0035
  168. /*** Lamp Alarm Mode attribute values ***/
  169. #define LIGHTING_BALLAST_LAMP_ALARM_MODE_BIT_0_NO_ALARM 0
  170. #define LIGHTING_BALLAST_LAMP_ALARM_MODE_BIT_0_ALARM 1
  171. /*******************************************************************************
  172. * TYPEDEFS
  173. */
  174. /*** ZCL Color Control Cluster: Move To Hue Cmd payload ***/
  175. typedef struct
  176. {
  177. uint8 hue;
  178. uint8 direction;
  179. uint16 transitionTime;
  180. } zclCmdLightingMoveToHuePayload_t;
  181. /*** ZCL Color Control Cluster: Move Hue Cmd payload ***/
  182. typedef struct
  183. {
  184. uint8 moveMode;
  185. uint8 rate;
  186. } zclCmdLightingMoveHuePayload_t;
  187. /*** ZCL Color Control Cluster: Step Hue Cmd payload ***/
  188. typedef struct
  189. {
  190. uint8 stepMode;
  191. uint8 transitionTime;
  192. } zclCmdLightingStepHuePayload_t;
  193. /*** ZCL Color Control Cluster: Move to Saturation Cmd payload ***/
  194. typedef struct
  195. {
  196. uint8 saturation;
  197. uint16 transitionTime;
  198. } zclCmdLightingMoveToSaturationPayload_t;
  199. /*** ZCL Color Control Cluster: Move Saturation Cmd payload ***/
  200. typedef struct
  201. {
  202. uint8 moveMode;
  203. uint8 rate;
  204. } zclCmdLightingMoveSaturationPayload_t;
  205. /*** ZCL Color Control Cluster: Step Saturation Cmd payload ***/
  206. typedef struct
  207. {
  208. uint8 stepMode;
  209. uint8 transitionTime;
  210. } zclCmdLightingStepSaturationPayload_t;
  211. /*** ZCL Color Control Cluster: Move To Hue and Saturation Cmd payload ***/
  212. typedef struct
  213. {
  214. uint8 hue;
  215. uint8 saturation;
  216. uint16 transitionTime;
  217. } zclCmdLightingMoveToHueAndSaturationPayload_t;
  218. /*** Structures used for callback functions ***/
  219. typedef struct
  220. {
  221. uint8 hue; // target hue value
  222. uint8 direction; // direction of change
  223. uint16 transitionTime; // tame taken to move to the target hue in 1/10 sec increments
  224. } zclCCMoveToHue_t;
  225. typedef struct
  226. {
  227. uint8 moveMode; // LIGHTING_MOVE_HUE_STOP, LIGHTING_MOVE_HUE_UP, LIGHTING_MOVE_HUE_DOWN
  228. uint8 rate; // the movement in steps per second, where step is a change in the device's hue of one unit
  229. } zclCCMoveHue_t;
  230. typedef struct
  231. {
  232. uint8 stepMode; // LIGHTING_STEP_HUE_UP, LIGHTING_STEP_HUE_DOWN
  233. uint8 stepSize; // change to the current value of the device's hue
  234. uint8 transitionTime; // the movement in steps per 1/10 second
  235. } zclCCStepHue_t;
  236. typedef struct
  237. {
  238. uint8 saturation; // target saturation value
  239. uint16 transitionTime; // time taken move to the target saturation, in 1/10 second units
  240. } zclCCMoveToSaturation_t;
  241. typedef struct
  242. {
  243. uint8 moveMode; // LIGHTING_MOVE_SATURATION_STOP, LIGHTING_MOVE_SATURATION_UP,
  244. // LIGHTING_MOVE_SATURATION_DOWN
  245. uint8 rate; // rate of movement in step/sec; step is the device's saturation of one unit
  246. } zclCCMoveSaturation_t;
  247. typedef struct
  248. {
  249. uint8 stepMode; // LIGHTING_STEP_SATURATION_UP, LIGHTING_STEP_SATURATION_DOWN
  250. uint8 stepSize; // change to the current value of the device's hue
  251. uint8 transitionTime; // time to perform a single step in 1/10 of second
  252. } zclCCStepSaturation_t;
  253. typedef struct
  254. {
  255. uint8 hue; // a target hue
  256. uint8 saturation; // a target saturation
  257. uint16 transitionTime; // time to move, equal of the value of the field in 1/10 seconds
  258. } zclCCMoveToHueAndSaturation_t;
  259. typedef struct
  260. {
  261. uint16 colorX; // a target color X
  262. uint16 colorY; // a target color Y
  263. uint16 transitionTime; // time to move, equal of the value of the field in 1/10 seconds
  264. } zclCCMoveToColor_t;
  265. typedef struct
  266. {
  267. int16 rateX; // rate of movement in steps per second. A step is a change
  268. // in the device's CurrentX attribute of one unit.
  269. int16 rateY; // rate of movement in steps per second. A step is a change
  270. // in the device's CurrentYattribute of one unit.
  271. } zclCCMoveColor_t;
  272. typedef struct
  273. {
  274. int16 stepX; // change to be added to the device's CurrentX attribute
  275. int16 stepY; // change to be added to the device's CurrentY attribute
  276. uint16 transitionTime; // time to move, equal of the value of the field in 1/10 seconds
  277. } zclCCStepColor_t;
  278. typedef struct
  279. {
  280. uint16 colorTemperature; // a target color temperature
  281. uint16 transitionTime; // time to move, equal of the value of the field in 1/10 seconds
  282. } zclCCMoveToColorTemperature_t;
  283. // This callback is called to process a Move To Hue command
  284. // hue - target hue value
  285. // direction
  286. // transitionTime - tame taken to move to the target hue in 1/10 sec increments
  287. typedef ZStatus_t (*zclLighting_ColorControl_MoveToHue_t)( zclCCMoveToHue_t *pCmd );
  288. // This callback is called to process a Move Hue command
  289. // moveMode - LIGHTING_MOVE_HUE_STOP, LIGHTING_MOVE_HUE_UP, LIGHTING_MOVE_HUE_DOWN
  290. // rate - the movement in steps per second, where step is a change in the device's hue of one unit
  291. typedef ZStatus_t (*zclLighting_ColorControl_MoveHue_t)( zclCCMoveHue_t *pCmd );
  292. // This callback is called to process a Step Hue command
  293. // stepMode - LIGHTING_STEP_HUE_UP, LIGHTING_STEP_HUE_DOWN
  294. // transitionTime - the movement in steps per 1/10 second
  295. typedef ZStatus_t (*zclLighting_ColorControl_StepHue_t)( zclCCStepHue_t *pCmd );
  296. // This callback is called to process a Move To Saturation command
  297. // saturation - target saturation value
  298. // transitionTime - time taken move to the target saturation, in 1/10 second units
  299. typedef ZStatus_t (*zclLighting_ColorControl_MoveToSaturation_t)( zclCCMoveToSaturation_t *pCmd );
  300. // This callback is called to process a Move Saturation command
  301. // moveMode - LIGHTING_MOVE_SATURATION_STOP, LIGHTING_MOVE_SATURATION_UP, LIGHTING_MOVE_SATURATION_DOWN
  302. // rate - rate of movement in step/sec; step is the device's saturation of one unit
  303. typedef ZStatus_t (*zclLighting_ColorControl_MoveSaturation_t)( zclCCMoveSaturation_t *pCmd );
  304. // This callback is called to process a Step Saturation command
  305. // stepMode - LIGHTING_STEP_SATURATION_UP, LIGHTING_STEP_SATURATION_DOWN
  306. // transitionTime - time to perform a single step in 1/10 of second
  307. typedef ZStatus_t (*zclLighting_ColorControl_StepSaturation_t)( zclCCStepSaturation_t *pCmd );
  308. // This callback is called to process a Move to Hue and Saturation command
  309. // hue - a target hue
  310. // saturation - a target saturation
  311. // transitionTime - time to move, equal of the value of the field in 1/10 seconds
  312. typedef ZStatus_t (*zclLighting_ColorControl_MoveToHueAndSaturation_t)( zclCCMoveToHueAndSaturation_t *pCmd );
  313. // This callback is called to process a Move to Color command
  314. // colorX - a target color X
  315. // colorY - a target color Y
  316. // transitionTime - time to move, equal of the value of the field in 1/10 seconds
  317. typedef ZStatus_t (*zclLighting_ColorControl_MoveToColor_t)( zclCCMoveToColor_t *pCmd );
  318. // This callback is called to process a Move Color command
  319. // rateX - rate of movement in steps per second. A step is a change
  320. // in the device's CurrentX attribute of one unit.
  321. // rateY - rate of movement in steps per second. A step is a change
  322. // in the device's CurrentY attribute of one unit.
  323. typedef void (*zclLighting_ColorControl_MoveColor_t)( zclCCMoveColor_t *pCmd );
  324. // This callback is called to process a Step Color command
  325. // stepX - change to be added to the device's CurrentX attribute
  326. // stepY - change to be added to the device's CurrentY attribute
  327. // transitionTime - time to perform the color change, equal of
  328. // the value of the field in 1/10 seconds
  329. typedef ZStatus_t (*zclLighting_ColorControl_StepColor_t)( zclCCStepColor_t *pCmd );
  330. // This callback is called to process a Move to Color Temperature command
  331. // colorTemperature - a target color temperature
  332. // transitionTime - time to perform the color change, equal of
  333. // the value of the field in 1/10 seconds
  334. typedef ZStatus_t (*zclLighting_ColorControl_MoveToColorTemperature_t)( zclCCMoveToColorTemperature_t *pCmd );
  335. // Register Callbacks table entry - enter function pointers for callbacks that
  336. // the application would like to receive
  337. typedef struct
  338. {
  339. zclLighting_ColorControl_MoveToHue_t pfnColorControl_MoveToHue;
  340. zclLighting_ColorControl_MoveHue_t pfnColorControl_MoveHue;
  341. zclLighting_ColorControl_StepHue_t pfnColorControl_StepHue;
  342. zclLighting_ColorControl_MoveToSaturation_t pfnColorControl_MoveToSaturation;
  343. zclLighting_ColorControl_MoveSaturation_t pfnColorControl_MoveSaturation;
  344. zclLighting_ColorControl_StepSaturation_t pfnColorControl_StepSaturation;
  345. zclLighting_ColorControl_MoveToHueAndSaturation_t pfnColorControl_MoveToHueAndSaturation;
  346. zclLighting_ColorControl_MoveToColor_t pfnColorControl_MoveToColor;
  347. zclLighting_ColorControl_MoveColor_t pfnColorControl_MoveColor;
  348. zclLighting_ColorControl_StepColor_t pfnColorControl_StepColor;
  349. zclLighting_ColorControl_MoveToColorTemperature_t pfnColorControl_MoveToColorTemperature;
  350. } zclLighting_AppCallbacks_t;
  351. /******************************************************************************
  352. * FUNCTION MACROS
  353. */
  354. /******************************************************************************
  355. * VARIABLES
  356. */
  357. /******************************************************************************
  358. * FUNCTIONS
  359. */
  360. /*
  361. * Register for callbacks from this cluster library
  362. */
  363. extern ZStatus_t zclLighting_RegisterCmdCallbacks( uint8 endpoint, zclLighting_AppCallbacks_t *callbacks );
  364. /*
  365. * Call to send out a Move To Hue Command
  366. * hue - target hue value
  367. * direction - direction of hue change
  368. * transitionTime - tame taken to move to the target hue in 1/10 sec increments
  369. */
  370. extern ZStatus_t zclLighting_ColorControl_Send_MoveToHueCmd( uint8 srcEP, afAddrType_t *dstAddr,
  371. uint8 hue, uint8 direction, uint16 transitionTime,
  372. uint8 disableDefaultRsp, uint8 seqNum );
  373. /*
  374. * Call to send out a Move Hue Command
  375. * moveMode - LIGHTING_MOVE_HUE_STOP, LIGHTING_MOVE_HUE_UP, LIGHTING_MOVE_HUE_DOWN
  376. * rate - the movement in steps per second (step is a change in the device's hue
  377. * of one unit)
  378. */
  379. extern ZStatus_t zclLighting_ColorControl_Send_MoveHueCmd( uint8 srcEP, afAddrType_t *dstAddr,
  380. uint8 moveMode, uint8 rate,
  381. uint8 disableDefaultRsp, uint8 seqNum );
  382. /*
  383. * Call to send out a Step Hue Command
  384. * stepMode - LIGHTING_STEP_HUE_UP, LIGHTING_STEP_HUE_DOWN
  385. * amount - number of hue units to step
  386. * transitionTime - the movement in steps per 1/10 second
  387. */
  388. extern ZStatus_t zclLighting_ColorControl_Send_StepHueCmd( uint8 srcEP, afAddrType_t *dstAddr,
  389. uint8 stepMode, uint8 stepSize, uint8 transitionTime,
  390. uint8 disableDefaultRsp, uint8 seqNum );
  391. /*
  392. * Call to send out a Move To Saturation Command
  393. * saturation - target saturation value
  394. * transitionTime - time taken move to the target saturation, in 1/10 second units
  395. */
  396. extern ZStatus_t zclLighting_ColorControl_Send_MoveToSaturationCmd( uint8 srcEP, afAddrType_t *dstAddr,
  397. uint8 saturation, uint16 transitionTime,
  398. uint8 disableDefaultRsp, uint8 seqNum );
  399. /*
  400. * Call to send out a Move Saturation Command
  401. * moveMode - LIGHTING_MOVE_SATURATION_STOP, LIGHTING_MOVE_SATURATION_UP,
  402. * LIGHTING_MOVE_SATURATION_DOWN
  403. * rate - rate of movement in step per second; step is the device's
  404. * saturation of one unit
  405. */
  406. extern ZStatus_t zclLighting_ColorControl_Send_MoveSaturationCmd( uint8 srcEP, afAddrType_t *dstAddr,
  407. uint8 moveMode, uint8 rate,
  408. uint8 disableDefaultRsp, uint8 seqNum );
  409. /*
  410. * Call to send out a Step Saturation Command
  411. * stepMode - LIGHTING_STEP_SATURATION_UP, LIGHTING_STEP_SATURATION_DOWN
  412. * amount - number of units to change the saturation level by
  413. * transitionTime - time to perform a single step in 1/10 of second
  414. */
  415. extern ZStatus_t zclLighting_ColorControl_Send_StepSaturationCmd( uint8 srcEP, afAddrType_t *dstAddr,
  416. uint8 stepMode, uint8 stepSize, uint8 transitionTime,
  417. uint8 disableDefaultRsp, uint8 seqNum );
  418. /*
  419. * Call to send out a Move To Hue And Saturation Command
  420. * hue - target hue
  421. * saturation - target saturation
  422. * transitionTime - time to move, equal of the value of the field in 1/10 seconds
  423. */
  424. extern ZStatus_t zclLighting_ColorControl_Send_MoveToHueAndSaturationCmd( uint8 srcEP, afAddrType_t *dstAddr,
  425. uint8 hue, uint8 saturation, uint16 transitionTime,
  426. uint8 disableDefaultRsp, uint8 seqNum );
  427. /*
  428. * Call to send out a Move To Color Command
  429. * colorX - target color X
  430. * colorY - target color Y
  431. * transitionTime - time to move, equal of the value of the field in 1/10 seconds
  432. */
  433. extern ZStatus_t zclLighting_ColorControl_Send_MoveToColorCmd( uint8 srcEP, afAddrType_t *dstAddr,
  434. uint16 colorX, uint16 colorY, uint16 transitionTime,
  435. uint8 disableDefaultRsp, uint8 seqNum );
  436. /*
  437. * Call to send out a Move Color Command
  438. * rateX - rate of movement in steps per second. A step is a change
  439. * in the device's CurrentX attribute of one unit.
  440. * rateY - rate of movement in steps per second. A step is a change
  441. * in the device's CurrentY attribute of one unit.
  442. */
  443. extern ZStatus_t zclLighting_ColorControl_Send_MoveColorCmd( uint8 srcEP, afAddrType_t *dstAddr,
  444. int16 rateX, int16 rateY,
  445. uint8 disableDefaultRsp, uint8 seqNum );
  446. /*
  447. * Call to send out a Step Color Command
  448. * stepX - change to be added to the device's CurrentX attribute
  449. * stepY - change to be added to the device's CurrentY attribute
  450. * transitionTime - time to perform the color change, equal of
  451. * the value of the field in 1/10 seconds
  452. */
  453. extern ZStatus_t zclLighting_ColorControl_Send_StepColorCmd( uint8 srcEP, afAddrType_t *dstAddr,
  454. int16 stepX, int16 stepY, uint16 transitionTime,
  455. uint8 disableDefaultRsp, uint8 seqNum );
  456. /*
  457. * Call to send out a Move To Color Temperature Command
  458. * colorTemperature - a target color temperature
  459. * transitionTime - time to perform the color change, equal of
  460. * the value of the field in 1/10 seconds
  461. */
  462. extern ZStatus_t zclLighting_ColorControl_Send_MoveToColorTemperatureCmd( uint8 srcEP, afAddrType_t *dstAddr,
  463. uint16 colorTemperature, uint16 transitionTime,
  464. uint8 disableDefaultRsp, uint8 seqNum );
  465. /*********************************************************************
  466. *********************************************************************/
  467. #ifdef __cplusplus
  468. }
  469. #endif
  470. #endif /* ZCL_LIGHTING_H */