123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543 |
- #ifndef ZCL_LIGHTING_H
- #define ZCL_LIGHTING_H
- #ifdef __cplusplus
- extern "C"
- {
- #endif
- #include "zcl.h"
-
-
- #define ATTRID_LIGHTING_COLOR_CONTROL_CURRENT_HUE 0x0000
- #define ATTRID_LIGHTING_COLOR_CONTROL_CURRENT_SATURATION 0x0001
- #define ATTRID_LIGHTING_COLOR_CONTROL_REMAINING_TIME 0x0002
- #define ATTRID_LIGHTING_COLOR_CONTROL_CURRENT_X 0x0003
- #define ATTRID_LIGHTING_COLOR_CONTROL_CURRENT_Y 0x0004
- #define ATTRID_LIGHTING_COLOR_CONTROL_DRIFT_COMPENSATION 0x0005
- #define ATTRID_LIGHTING_COLOR_CONTROL_COMPENSATION_TEXT 0x0006
- #define ATTRID_LIGHTING_COLOR_CONTROL_COLOR_TEMPERATURE 0x0007
- #define ATTRID_LIGHTING_COLOR_CONTROL_COLOR_MODE 0x0008
-
-
- #define ATTRID_LIGHTING_COLOR_CONTROL_NUM_PRIMARIES 0x0010
- #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_1_X 0x0011
- #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_1_Y 0x0012
- #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_1_INTENSITY 0x0013
-
- #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_2_X 0x0015
- #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_2_Y 0x0016
- #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_2_INTENSITY 0x0017
-
- #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_3_X 0x0019
- #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_3_Y 0x001a
- #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_3_INTENSITY 0x001b
-
- #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_4_X 0x0020
- #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_4_Y 0x0021
- #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_4_INTENSITY 0x0022
-
- #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_5_X 0x0024
- #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_5_Y 0x0025
- #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_5_INTENSITY 0x0026
-
- #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_6_X 0x0028
- #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_6_Y 0x0029
- #define ATTRID_LIGHTING_COLOR_CONTROL_PRIMARY_6_INTENSITY 0x002a
-
- #define ATTRID_LIGHTING_COLOR_CONTROL_WHITE_POINT_X 0x0030
- #define ATTRID_LIGHTING_COLOR_CONTROL_WHITE_POINT_Y 0x0031
- #define ATTRID_LIGHTING_COLOR_CONTROL_COLOR_POINT_R_X 0x0032
- #define ATTRID_LIGHTING_COLOR_CONTROL_COLOR_POINT_R_Y 0x0033
- #define ATTRID_LIGHTING_COLOR_CONTROL_COLOR_POINT_R_INTENSITY 0x0034
-
- #define ATTRID_LIGHTING_COLOR_CONTROL_COLOR_POINT_G_X 0x0036
- #define ATTRID_LIGHTING_COLOR_CONTROL_COLOR_POINT_G_Y 0x0037
- #define ATTRID_LIGHTING_COLOR_CONTROL_COLOR_POINT_B_INTENSITY 0x0038
-
- #define ATTRID_LIGHTING_COLOR_CONTROL_COLOR_POINT_B_X 0x003a
- #define ATTRID_LIGHTING_COLOR_CONTROL_COLOR_POINT_B_Y 0x003b
- #define ATTRID_LIGHTING_COLOR_CONTROL_COLOR_POINT_G_INTENSITY 0x003c
-
-
-
- #define DRIFT_COMP_NONE 0x00
- #define DRIFT_COMP_OTHER_UNKNOWN 0x01
- #define DRIFT_COMP_TEMPERATURE_MONITOR 0x02
- #define DRIFT_COMP_OPTICAL_LUMINANCE_MONITOR_FEEDBACK 0x03
- #define DRIFT_COMP_OPTICAL_COLOR_MONITOR_FEEDBACK 0x04
-
-
- #define COLOR_MODE_CURRENT_HUE_SATURATION 0x00
- #define COLOR_MODE_CURRENT_X_Y 0x01
- #define COLOR_MODE_COLOR_TEMPERATURE 0x02
-
- #define COMMAND_LIGHTING_MOVE_TO_HUE 0x00
- #define COMMAND_LIGHTING_MOVE_HUE 0x01
- #define COMMAND_LIGHTING_STEP_HUE 0x02
- #define COMMAND_LIGHTING_MOVE_TO_SATURATION 0x03
- #define COMMAND_LIGHTING_MOVE_SATURATION 0x04
- #define COMMAND_LIGHTING_STEP_SATURATION 0x05
- #define COMMAND_LIGHTING_MOVE_TO_HUE_AND_SATURATION 0x06
- #define COMMAND_LIGHTING_MOVE_TO_COLOR 0x07
- #define COMMAND_LIGHTING_MOVE_COLOR 0x08
- #define COMMAND_LIGHTING_STEP_COLOR 0x09
- #define COMMAND_LIGHTING_MOVE_TO_COLOR_TEMPERATURE 0x0a
-
-
- #define LIGHTING_MOVE_TO_HUE_DIRECTION_SHORTEST_DISTANCE 0x00
- #define LIGHTING_MOVE_TO_HUE_DIRECTION_LONGEST_DISTANCE 0x01
- #define LIGHTING_MOVE_TO_HUE_DIRECTION_UP 0x02
- #define LIGHTING_MOVE_TO_HUE_DIRECTION_DOWN 0x03
-
- #define LIGHTING_MOVE_HUE_STOP 0x00
- #define LIGHTING_MOVE_HUE_UP 0x01
- #define LIGHTING_MOVE_HUE_DOWN 0x03
-
- #define LIGHTING_STEP_HUE_UP 0x01
- #define LIGHTING_STEP_HUE_DOWN 0x03
-
- #define LIGHTING_MOVE_SATURATION_STOP 0x00
- #define LIGHTING_MOVE_SATURATION_UP 0x01
- #define LIGHTING_MOVE_SATURATION_DOWN 0x03
-
- #define LIGHTING_STEP_SATURATION_UP 0x01
- #define LIGHTING_STEP_SATURATION_DOWN 0x03
-
- #define ATTRID_LIGHTING_BALLAST_CONFIG_PHYSICAL_MIN_LEVEL 0x0000
- #define ATTRID_LIGHTING_BALLAST_CONFIG_PHYSICAL_MAX_LEVEL 0x0001
- #define ATTRID_LIGHTING_BALLAST_BALLAST_STATUS 0x0002
- #define LIGHTING_BALLAST_STATUS_NON_OPERATIONAL 1 // bit 0 is set
- #define LIGHTING_BALLAST_STATUS_LAMP_IS_NOT_IN_SOCKET 2 // bit 1 is set
-
- #define ATTRID_LIGHTING_BALLAST_MIN_LEVEL 0x0010
- #define ATTRID_LIGHTING_BALLAST_MAX_LEVEL 0x0011
- #define ATTRID_LIGHTING_BALLAST_POWER_ON_LEVEL 0x0012
- #define ATTRID_LIGHTING_BALLAST_POWER_ON_FADE_TIME 0x0013
- #define ATTRID_LIGHTING_BALLAST_INTRISTIC_BALLAST_FACTOR 0x0014
- #define ATTRID_LIGHTING_BALLAST_BALLAST_FACTOR_ADJUSTMENT 0x0015
-
- #define ATTRID_LIGHTING_BALLAST_LAMP_QUANTITY 0x0020
-
- #define ATTRID_LIGHTING_BALLAST_LAMP_TYPE 0x0030
- #define ATTRID_LIGHTING_BALLAST_LAMP_MANUFACTURER 0x0031
- #define ATTRID_LIGHTING_BALLAST_LAMP_RATED_HOURS 0x0032
- #define ATTRID_LIGHTING_BALLAST_LAMP_BURN_HOURS 0x0033
- #define ATTRID_LIGHTING_BALLAST_LAMP_ALARM_MODE 0x0034
- #define ATTRID_LIGHTING_BALLAST_LAMP_BURN_HOURS_TRIP_POINT 0x0035
- #define LIGHTING_BALLAST_LAMP_ALARM_MODE_BIT_0_NO_ALARM 0
- #define LIGHTING_BALLAST_LAMP_ALARM_MODE_BIT_0_ALARM 1
- typedef struct
- {
- uint8 hue;
- uint8 direction;
- uint16 transitionTime;
- } zclCmdLightingMoveToHuePayload_t;
- typedef struct
- {
- uint8 moveMode;
- uint8 rate;
- } zclCmdLightingMoveHuePayload_t;
- typedef struct
- {
- uint8 stepMode;
- uint8 transitionTime;
- } zclCmdLightingStepHuePayload_t;
- typedef struct
- {
- uint8 saturation;
- uint16 transitionTime;
- } zclCmdLightingMoveToSaturationPayload_t;
- typedef struct
- {
- uint8 moveMode;
- uint8 rate;
- } zclCmdLightingMoveSaturationPayload_t;
- typedef struct
- {
- uint8 stepMode;
- uint8 transitionTime;
- } zclCmdLightingStepSaturationPayload_t;
- typedef struct
- {
- uint8 hue;
- uint8 saturation;
- uint16 transitionTime;
- } zclCmdLightingMoveToHueAndSaturationPayload_t;
- typedef struct
- {
- uint8 hue;
- uint8 direction;
- uint16 transitionTime;
- } zclCCMoveToHue_t;
- typedef struct
- {
- uint8 moveMode;
- uint8 rate;
- } zclCCMoveHue_t;
- typedef struct
- {
- uint8 stepMode;
- uint8 stepSize;
- uint8 transitionTime;
- } zclCCStepHue_t;
- typedef struct
- {
- uint8 saturation;
- uint16 transitionTime;
- } zclCCMoveToSaturation_t;
- typedef struct
- {
- uint8 moveMode;
-
- uint8 rate;
- } zclCCMoveSaturation_t;
- typedef struct
- {
- uint8 stepMode;
- uint8 stepSize;
- uint8 transitionTime;
- } zclCCStepSaturation_t;
- typedef struct
- {
- uint8 hue;
- uint8 saturation;
- uint16 transitionTime;
- } zclCCMoveToHueAndSaturation_t;
-
- typedef struct
- {
- uint16 colorX;
- uint16 colorY;
- uint16 transitionTime;
- } zclCCMoveToColor_t;
- typedef struct
- {
- int16 rateX;
-
- int16 rateY;
-
- } zclCCMoveColor_t;
- typedef struct
- {
- int16 stepX;
- int16 stepY;
- uint16 transitionTime;
- } zclCCStepColor_t;
- typedef struct
- {
- uint16 colorTemperature;
- uint16 transitionTime;
- } zclCCMoveToColorTemperature_t;
- typedef ZStatus_t (*zclLighting_ColorControl_MoveToHue_t)( zclCCMoveToHue_t *pCmd );
- typedef ZStatus_t (*zclLighting_ColorControl_MoveHue_t)( zclCCMoveHue_t *pCmd );
- typedef ZStatus_t (*zclLighting_ColorControl_StepHue_t)( zclCCStepHue_t *pCmd );
- typedef ZStatus_t (*zclLighting_ColorControl_MoveToSaturation_t)( zclCCMoveToSaturation_t *pCmd );
- typedef ZStatus_t (*zclLighting_ColorControl_MoveSaturation_t)( zclCCMoveSaturation_t *pCmd );
- typedef ZStatus_t (*zclLighting_ColorControl_StepSaturation_t)( zclCCStepSaturation_t *pCmd );
- typedef ZStatus_t (*zclLighting_ColorControl_MoveToHueAndSaturation_t)( zclCCMoveToHueAndSaturation_t *pCmd );
- typedef ZStatus_t (*zclLighting_ColorControl_MoveToColor_t)( zclCCMoveToColor_t *pCmd );
- typedef void (*zclLighting_ColorControl_MoveColor_t)( zclCCMoveColor_t *pCmd );
- typedef ZStatus_t (*zclLighting_ColorControl_StepColor_t)( zclCCStepColor_t *pCmd );
- typedef ZStatus_t (*zclLighting_ColorControl_MoveToColorTemperature_t)( zclCCMoveToColorTemperature_t *pCmd );
- typedef struct
- {
- zclLighting_ColorControl_MoveToHue_t pfnColorControl_MoveToHue;
- zclLighting_ColorControl_MoveHue_t pfnColorControl_MoveHue;
- zclLighting_ColorControl_StepHue_t pfnColorControl_StepHue;
- zclLighting_ColorControl_MoveToSaturation_t pfnColorControl_MoveToSaturation;
- zclLighting_ColorControl_MoveSaturation_t pfnColorControl_MoveSaturation;
- zclLighting_ColorControl_StepSaturation_t pfnColorControl_StepSaturation;
- zclLighting_ColorControl_MoveToHueAndSaturation_t pfnColorControl_MoveToHueAndSaturation;
- zclLighting_ColorControl_MoveToColor_t pfnColorControl_MoveToColor;
- zclLighting_ColorControl_MoveColor_t pfnColorControl_MoveColor;
- zclLighting_ColorControl_StepColor_t pfnColorControl_StepColor;
- zclLighting_ColorControl_MoveToColorTemperature_t pfnColorControl_MoveToColorTemperature;
-
- } zclLighting_AppCallbacks_t;
- extern ZStatus_t zclLighting_RegisterCmdCallbacks( uint8 endpoint, zclLighting_AppCallbacks_t *callbacks );
- extern ZStatus_t zclLighting_ColorControl_Send_MoveToHueCmd( uint8 srcEP, afAddrType_t *dstAddr,
- uint8 hue, uint8 direction, uint16 transitionTime,
- uint8 disableDefaultRsp, uint8 seqNum );
- extern ZStatus_t zclLighting_ColorControl_Send_MoveHueCmd( uint8 srcEP, afAddrType_t *dstAddr,
- uint8 moveMode, uint8 rate,
- uint8 disableDefaultRsp, uint8 seqNum );
- extern ZStatus_t zclLighting_ColorControl_Send_StepHueCmd( uint8 srcEP, afAddrType_t *dstAddr,
- uint8 stepMode, uint8 stepSize, uint8 transitionTime,
- uint8 disableDefaultRsp, uint8 seqNum );
- extern ZStatus_t zclLighting_ColorControl_Send_MoveToSaturationCmd( uint8 srcEP, afAddrType_t *dstAddr,
- uint8 saturation, uint16 transitionTime,
- uint8 disableDefaultRsp, uint8 seqNum );
- extern ZStatus_t zclLighting_ColorControl_Send_MoveSaturationCmd( uint8 srcEP, afAddrType_t *dstAddr,
- uint8 moveMode, uint8 rate,
- uint8 disableDefaultRsp, uint8 seqNum );
- extern ZStatus_t zclLighting_ColorControl_Send_StepSaturationCmd( uint8 srcEP, afAddrType_t *dstAddr,
- uint8 stepMode, uint8 stepSize, uint8 transitionTime,
- uint8 disableDefaultRsp, uint8 seqNum );
- extern ZStatus_t zclLighting_ColorControl_Send_MoveToHueAndSaturationCmd( uint8 srcEP, afAddrType_t *dstAddr,
- uint8 hue, uint8 saturation, uint16 transitionTime,
- uint8 disableDefaultRsp, uint8 seqNum );
- extern ZStatus_t zclLighting_ColorControl_Send_MoveToColorCmd( uint8 srcEP, afAddrType_t *dstAddr,
- uint16 colorX, uint16 colorY, uint16 transitionTime,
- uint8 disableDefaultRsp, uint8 seqNum );
- extern ZStatus_t zclLighting_ColorControl_Send_MoveColorCmd( uint8 srcEP, afAddrType_t *dstAddr,
- int16 rateX, int16 rateY,
- uint8 disableDefaultRsp, uint8 seqNum );
- extern ZStatus_t zclLighting_ColorControl_Send_StepColorCmd( uint8 srcEP, afAddrType_t *dstAddr,
- int16 stepX, int16 stepY, uint16 transitionTime,
- uint8 disableDefaultRsp, uint8 seqNum );
- extern ZStatus_t zclLighting_ColorControl_Send_MoveToColorTemperatureCmd( uint8 srcEP, afAddrType_t *dstAddr,
- uint16 colorTemperature, uint16 transitionTime,
- uint8 disableDefaultRsp, uint8 seqNum );
- #ifdef __cplusplus
- }
- #endif
- #endif /* ZCL_LIGHTING_H */
|