smart-green-house/project_ZigBee/Components/stack/zcl/zcl_ms.h

194 lines
9.9 KiB
C

/**************************************************************************************************
Filename: zcl_ms.h
Revised: $Date: 2010-02-09 15:28:14 -0800 (Tue, 09 Feb 2010) $
Revision: $Revision: 21679 $
Description: This file contains the ZCL Measurement and Sensing Definitions
Copyright 2006-2010 Texas Instruments Incorporated. All rights reserved.
IMPORTANT: Your use of this Software is limited to those specific rights
granted under the terms of a software license agreement between the user
who downloaded the software, his/her employer (which must be your employer)
and Texas Instruments Incorporated (the "License"). You may not use this
Software unless you agree to abide by the terms of the License. The License
limits your use, and you acknowledge, that the Software may not be modified,
copied or distributed unless embedded on a Texas Instruments microcontroller
or used solely and exclusively in conjunction with a Texas Instruments radio
frequency transceiver, which is integrated into your product. Other than for
the foregoing purpose, you may not use, reproduce, copy, prepare derivative
works of, modify, distribute, perform, display or sell this Software and/or
its documentation for any purpose.
YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
(INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
Should you have any questions regarding your right to use this Software,
contact Texas Instruments Incorporated at www.TI.com.
**************************************************************************************************/
#ifndef ZCL_MS_H
#define ZCL_MS_H
#ifdef __cplusplus
extern "C"
{
#endif
/*********************************************************************
* INCLUDES
*/
#include "zcl.h"
/*********************************************************************
* CONSTANTS
*/
/*****************************************************************************/
/*** Illuminance Measurement Cluster Attributes ***/
/*****************************************************************************/
// Illuminance Measurement Information attribute set
#define ATTRID_MS_ILLUMINANCE_MEASURED_VALUE 0x0000
#define ATTRID_MS_ILLUMINANCE_MIN_MEASURED_VALUE 0x0001
#define ATTRID_MS_ILLUMINANCE_MAX_MEASURED_VALUE 0x0002
#define ATTRID_MS_ILLUMINANCE_TOLERANCE 0x0003
#define ATTRID_MS_ILLUMINANCE_LIGHT_SENSOR_TYPE 0x0004
// Illuminance Measurement Settings attribute set
// #define ATTRID_MS_ILLUMINANCE_MIN_PERCENT_CHANGE 0x0100
// #define ATTRID_MS_ILLUMINANCE_MIN_ABSOLUTE_CHANGE 0x0101
/*** Light Sensor Type attribute values ***/
#define MS_ILLUMINANCE_LIGHT_SENSOR_PHOTODIODE 0x00
#define MS_ILLUMINANCE_LIGHT_SENSOR_CMOS 0x01
#define MS_ILLUMINANCE_LIGHT_SENSOR_UNKNOWN 0xFF
/*****************************************************************************/
/*** Illuminance Level Sensing Configuration Cluster Attributes ***/
/*****************************************************************************/
// Illuminance Level Sensing Information attribute set
#define ATTRID_MS_ILLUMINANCE_LEVEL_STATUS 0x0000
#define ATTRID_MS_ILLUMINANCE_LEVEL_LIGHT_SENSOR_TYPE 0x0001
/*** Level Status attribute values ***/
#define MS_ILLUMINANCE_LEVEL_ON_TARGET 0x00
#define MS_ILLUMINANCE_LEVEL_BELOW_TARGET 0x01
#define MS_ILLUMINANCE_LEVEL_ABOVE_TARGET 0x02
/*** Light Sensor Type attribute values ***/
#define MS_ILLUMINANCE_LEVEL_LIGHT_SENSOR_PHOTODIODE 0x00
#define MS_ILLUMINANCE_LEVEL_LIGHT_SENSOR_CMOS 0x01
#define MS_ILLUMINANCE_LEVEL_LIGHT_SENSOR_UNKNOWN 0xFF
// Illuminance Level Sensing Settings attribute set
#define ATTRID_MS_ILLUMINANCE_TARGET_LEVEL 0x0010
/*****************************************************************************/
/*** Temperature Measurement Cluster Attributes ***/
/*****************************************************************************/
// Temperature Measurement Information attributes set
#define ATTRID_MS_TEMPERATURE_MEASURED_VALUE 0x0000
#define ATTRID_MS_TEMPERATURE_MIN_MEASURED_VALUE 0x0001
#define ATTRID_MS_TEMPERATURE_MAX_MEASURED_VALUE 0x0002
#define ATTRID_MS_TEMPERATURE_TOLERANCE 0x0003
// Temperature Measurement Settings attributes set
#define ATTRID_MS_TEMPERATURE_MIN_PERCENT_CHANGE 0x0010
#define ATTRID_MS_TEMPERATURE_MIN_ABSOLUTE_CHANGE 0x0011
/*****************************************************************************/
/*** Pressure Measurement Cluster Attributes ***/
/*****************************************************************************/
// Pressure Measurement Information attribute set
#define ATTRID_MS_PRESSURE_MEASUREMENT_MEASURED_VALUE 0x0000
#define ATTRID_MS_PRESSURE_MEASUREMENT_MIN_MEASURED_VALUE 0x0001
#define ATTRID_MS_PRESSURE_MEASUREMENT_MAX_MEASURED_VALUE 0x0002
#define ATTRID_MS_PRESSURE_MEASUREMENT_TOLERANCE 0x0003
// Pressure Measurement Settings attribute set
// #define ATTRID_MS_PRESSURE_MEASUREMENT_MIN_PERCENT_CHANGE 0x0100
// #define ATTRID_MS_PRESSURE_MEASUREMENT_MIN_ABSOLUTE_CHANGE 0x0101
/*****************************************************************************/
/*** Flow Measurement Cluster Attributes ***/
/*****************************************************************************/
// Flow Measurement Information attribute set
#define ATTRID_MS_FLOW_MEASUREMENT_MEASURED_VALUE 0x0000
#define ATTRID_MS_FLOW_MEASUREMENT_MIN_MEASURED_VALUE 0x0001
#define ATTRID_MS_FLOW_MEASUREMENT_MAX_MEASURED_VALUE 0x0002
#define ATTRID_MS_FLOW_MEASUREMENT_TOLERANCE 0x0003
// Flow Measurement Settings attribute set
// #define ATTRID_MS_FLOW_MEASUREMENT_MIN_PERCENT_CHANGE 0x0100
// #define ATTRID_MS_FLOW_MEASUREMENT_MIN_ABSOLUTE_CHANGE 0x0101
/*****************************************************************************/
/*** Relative Humidity Cluster Attributes ***/
/*****************************************************************************/
// Relative Humidity Information attribute set
#define ATTRID_MS_RELATIVE_HUMIDITY_MEASURED_VALUE 0x0000
#define ATTRID_MS_RELATIVE_HUMIDITY_MIN_MEASURED_VALUE 0x0001
#define ATTRID_MS_RELATIVE_HUMIDITY_MAX_MEASURED_VALUE 0x0002
#define ATTRID_MS_RELATIVE_HUMIDITY_TOLERANCE 0x0003
/*****************************************************************************/
/*** Occupancy Sensing Cluster Attributes ***/
/*****************************************************************************/
// Occupancy Sensor Configuration attribute set
#define ATTRID_MS_OCCUPANCY_SENSING_CONFIG_OCCUPANCY 0x0000
#define ATTRID_MS_OCCUPANCY_SENSING_CONFIG_OCCUPANCY_SENSOR_TYPE 0x0001
/*** Occupancy Sensor Type Attribute values ***/
#define MS_OCCUPANCY_SENSOR_TYPE_PIR 0x00
#define MS_OCCUPANCY_SENSOR_TYPE_ULTRASONIC 0x01
#define MS_OCCUPANCY_SENSOR_TYPE_PIR_AND_ULTRASONIC 0x02
// PIR Configuration attribute set
#define ATTRID_MS_OCCUPANCY_SENSING_CONFIG_PIR_O_TO_U_DELAY 0x0010
#define ATTRID_MS_OCCUPANCY_SENSING_CONFIG_PIR_U_TO_O_DELAY 0x0011
// Ultrasonic Configuration attribute set
#define ATTRID_MS_OCCUPANCY_SENSING_CONFIG_ULTRASONIC_O_TO_U_DELAY 0x0020
#define ATTRID_MS_OCCUPANCY_SENSING_CONFIG_ULTRASONIC_U_TO_O_DELAY 0x0021
/************************************************************************************
* MACROS
*/
/****************************************************************************
* TYPEDEFS
*/
typedef void (*zclMS_PlaceHolder_t)( void );
// Register Callbacks table entry - enter function pointers for callbacks that
// the application would like to receive
typedef struct
{
zclMS_PlaceHolder_t pfnMSPlaceHolder; // Place Holder
// NULL
} zclMS_AppCallbacks_t;
/****************************************************************************
* VARIABLES
*/
/****************************************************************************
* FUNCTIONS
*/
/*
* Register for callbacks from this cluster library
*/
extern ZStatus_t zclMS_RegisterCmdCallbacks( uint8 endpoint, zclMS_AppCallbacks_t *callbacks );
#ifdef __cplusplus
}
#endif
#endif /* ZCL_MS_H */