zcl_ms.h 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. /**************************************************************************************************
  2. Filename: zcl_ms.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 Measurement and Sensing 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_MS_H
  34. #define ZCL_MS_H
  35. #ifdef __cplusplus
  36. extern "C"
  37. {
  38. #endif
  39. /*********************************************************************
  40. * INCLUDES
  41. */
  42. #include "zcl.h"
  43. /*********************************************************************
  44. * CONSTANTS
  45. */
  46. /*****************************************************************************/
  47. /*** Illuminance Measurement Cluster Attributes ***/
  48. /*****************************************************************************/
  49. // Illuminance Measurement Information attribute set
  50. #define ATTRID_MS_ILLUMINANCE_MEASURED_VALUE 0x0000
  51. #define ATTRID_MS_ILLUMINANCE_MIN_MEASURED_VALUE 0x0001
  52. #define ATTRID_MS_ILLUMINANCE_MAX_MEASURED_VALUE 0x0002
  53. #define ATTRID_MS_ILLUMINANCE_TOLERANCE 0x0003
  54. #define ATTRID_MS_ILLUMINANCE_LIGHT_SENSOR_TYPE 0x0004
  55. // Illuminance Measurement Settings attribute set
  56. // #define ATTRID_MS_ILLUMINANCE_MIN_PERCENT_CHANGE 0x0100
  57. // #define ATTRID_MS_ILLUMINANCE_MIN_ABSOLUTE_CHANGE 0x0101
  58. /*** Light Sensor Type attribute values ***/
  59. #define MS_ILLUMINANCE_LIGHT_SENSOR_PHOTODIODE 0x00
  60. #define MS_ILLUMINANCE_LIGHT_SENSOR_CMOS 0x01
  61. #define MS_ILLUMINANCE_LIGHT_SENSOR_UNKNOWN 0xFF
  62. /*****************************************************************************/
  63. /*** Illuminance Level Sensing Configuration Cluster Attributes ***/
  64. /*****************************************************************************/
  65. // Illuminance Level Sensing Information attribute set
  66. #define ATTRID_MS_ILLUMINANCE_LEVEL_STATUS 0x0000
  67. #define ATTRID_MS_ILLUMINANCE_LEVEL_LIGHT_SENSOR_TYPE 0x0001
  68. /*** Level Status attribute values ***/
  69. #define MS_ILLUMINANCE_LEVEL_ON_TARGET 0x00
  70. #define MS_ILLUMINANCE_LEVEL_BELOW_TARGET 0x01
  71. #define MS_ILLUMINANCE_LEVEL_ABOVE_TARGET 0x02
  72. /*** Light Sensor Type attribute values ***/
  73. #define MS_ILLUMINANCE_LEVEL_LIGHT_SENSOR_PHOTODIODE 0x00
  74. #define MS_ILLUMINANCE_LEVEL_LIGHT_SENSOR_CMOS 0x01
  75. #define MS_ILLUMINANCE_LEVEL_LIGHT_SENSOR_UNKNOWN 0xFF
  76. // Illuminance Level Sensing Settings attribute set
  77. #define ATTRID_MS_ILLUMINANCE_TARGET_LEVEL 0x0010
  78. /*****************************************************************************/
  79. /*** Temperature Measurement Cluster Attributes ***/
  80. /*****************************************************************************/
  81. // Temperature Measurement Information attributes set
  82. #define ATTRID_MS_TEMPERATURE_MEASURED_VALUE 0x0000
  83. #define ATTRID_MS_TEMPERATURE_MIN_MEASURED_VALUE 0x0001
  84. #define ATTRID_MS_TEMPERATURE_MAX_MEASURED_VALUE 0x0002
  85. #define ATTRID_MS_TEMPERATURE_TOLERANCE 0x0003
  86. // Temperature Measurement Settings attributes set
  87. #define ATTRID_MS_TEMPERATURE_MIN_PERCENT_CHANGE 0x0010
  88. #define ATTRID_MS_TEMPERATURE_MIN_ABSOLUTE_CHANGE 0x0011
  89. /*****************************************************************************/
  90. /*** Pressure Measurement Cluster Attributes ***/
  91. /*****************************************************************************/
  92. // Pressure Measurement Information attribute set
  93. #define ATTRID_MS_PRESSURE_MEASUREMENT_MEASURED_VALUE 0x0000
  94. #define ATTRID_MS_PRESSURE_MEASUREMENT_MIN_MEASURED_VALUE 0x0001
  95. #define ATTRID_MS_PRESSURE_MEASUREMENT_MAX_MEASURED_VALUE 0x0002
  96. #define ATTRID_MS_PRESSURE_MEASUREMENT_TOLERANCE 0x0003
  97. // Pressure Measurement Settings attribute set
  98. // #define ATTRID_MS_PRESSURE_MEASUREMENT_MIN_PERCENT_CHANGE 0x0100
  99. // #define ATTRID_MS_PRESSURE_MEASUREMENT_MIN_ABSOLUTE_CHANGE 0x0101
  100. /*****************************************************************************/
  101. /*** Flow Measurement Cluster Attributes ***/
  102. /*****************************************************************************/
  103. // Flow Measurement Information attribute set
  104. #define ATTRID_MS_FLOW_MEASUREMENT_MEASURED_VALUE 0x0000
  105. #define ATTRID_MS_FLOW_MEASUREMENT_MIN_MEASURED_VALUE 0x0001
  106. #define ATTRID_MS_FLOW_MEASUREMENT_MAX_MEASURED_VALUE 0x0002
  107. #define ATTRID_MS_FLOW_MEASUREMENT_TOLERANCE 0x0003
  108. // Flow Measurement Settings attribute set
  109. // #define ATTRID_MS_FLOW_MEASUREMENT_MIN_PERCENT_CHANGE 0x0100
  110. // #define ATTRID_MS_FLOW_MEASUREMENT_MIN_ABSOLUTE_CHANGE 0x0101
  111. /*****************************************************************************/
  112. /*** Relative Humidity Cluster Attributes ***/
  113. /*****************************************************************************/
  114. // Relative Humidity Information attribute set
  115. #define ATTRID_MS_RELATIVE_HUMIDITY_MEASURED_VALUE 0x0000
  116. #define ATTRID_MS_RELATIVE_HUMIDITY_MIN_MEASURED_VALUE 0x0001
  117. #define ATTRID_MS_RELATIVE_HUMIDITY_MAX_MEASURED_VALUE 0x0002
  118. #define ATTRID_MS_RELATIVE_HUMIDITY_TOLERANCE 0x0003
  119. /*****************************************************************************/
  120. /*** Occupancy Sensing Cluster Attributes ***/
  121. /*****************************************************************************/
  122. // Occupancy Sensor Configuration attribute set
  123. #define ATTRID_MS_OCCUPANCY_SENSING_CONFIG_OCCUPANCY 0x0000
  124. #define ATTRID_MS_OCCUPANCY_SENSING_CONFIG_OCCUPANCY_SENSOR_TYPE 0x0001
  125. /*** Occupancy Sensor Type Attribute values ***/
  126. #define MS_OCCUPANCY_SENSOR_TYPE_PIR 0x00
  127. #define MS_OCCUPANCY_SENSOR_TYPE_ULTRASONIC 0x01
  128. #define MS_OCCUPANCY_SENSOR_TYPE_PIR_AND_ULTRASONIC 0x02
  129. // PIR Configuration attribute set
  130. #define ATTRID_MS_OCCUPANCY_SENSING_CONFIG_PIR_O_TO_U_DELAY 0x0010
  131. #define ATTRID_MS_OCCUPANCY_SENSING_CONFIG_PIR_U_TO_O_DELAY 0x0011
  132. // Ultrasonic Configuration attribute set
  133. #define ATTRID_MS_OCCUPANCY_SENSING_CONFIG_ULTRASONIC_O_TO_U_DELAY 0x0020
  134. #define ATTRID_MS_OCCUPANCY_SENSING_CONFIG_ULTRASONIC_U_TO_O_DELAY 0x0021
  135. /************************************************************************************
  136. * MACROS
  137. */
  138. /****************************************************************************
  139. * TYPEDEFS
  140. */
  141. typedef void (*zclMS_PlaceHolder_t)( void );
  142. // Register Callbacks table entry - enter function pointers for callbacks that
  143. // the application would like to receive
  144. typedef struct
  145. {
  146. zclMS_PlaceHolder_t pfnMSPlaceHolder; // Place Holder
  147. // NULL
  148. } zclMS_AppCallbacks_t;
  149. /****************************************************************************
  150. * VARIABLES
  151. */
  152. /****************************************************************************
  153. * FUNCTIONS
  154. */
  155. /*
  156. * Register for callbacks from this cluster library
  157. */
  158. extern ZStatus_t zclMS_RegisterCmdCallbacks( uint8 endpoint, zclMS_AppCallbacks_t *callbacks );
  159. #ifdef __cplusplus
  160. }
  161. #endif
  162. #endif /* ZCL_MS_H */