Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * window_covering.h
- *
- * Created on: Jun 1, 2019
- * Author: TrungTQ9
- */
- #ifndef WINDOW_COVERING_H_
- #define WINDOW_COVERING_H_
- #include <jendefs.h>
- #include "zcl.h"
- #include "zcl_options.h"
- #include "Basic.h"
- #include "Identify.h"
- #include "Groups.h"
- #include "Scenes.h"
- #include "WindowCovering.h"
- #ifdef CLD_OTA
- #include "OTA.h"
- #endif
- #if defined __cplusplus
- extern "C" {
- #endif
- /****************************************************************************/
- /*** Macro Definitions ***/
- /****************************************************************************/
- #define CLOSURES_WINDOW_COVERING_DEVICE_ID 0x0202
- /****************************************************************************/
- /*** Type Definitions ***/
- /****************************************************************************/
- /* Holds cluster instances */
- typedef struct {
- /* All HA devices have 2 mandatory clusters - Basic(server) and Identify(server) */
- #if (defined CLD_BASIC) && (defined BASIC_SERVER)
- tsZCL_ClusterInstance sBasicServer;
- #endif
- #if (defined CLD_IDENTIFY) && (defined IDENTIFY_SERVER)
- tsZCL_ClusterInstance sIdentifyServer;
- #endif
- #if (defined CLD_SCENES) && (defined SCENES_SERVER)
- tsZCL_ClusterInstance sScenesServer;
- #endif
- #if (defined CLD_GROUPS) && (defined GROUPS_SERVER)
- tsZCL_ClusterInstance sGroupsServer;
- #endif
- #if (defined CLD_WINDOWCOVERING) && (defined WINDOWCOVERING_SERVER)
- tsZCL_ClusterInstance sWindowCoveringServer;
- #endif
- #ifdef CLD_OTA
- #ifdef OTA_CLIENT
- /* Add cluster instance for the OTA cluster */
- tsZCL_ClusterInstance sOTAClient;
- #endif
- #ifdef OTA_SERVER
- /* Add server instance for the OTA cluster */
- tsZCL_ClusterInstance sOTAServer;
- #endif
- #endif
- } tsHA_WindowCoveringDeviceClusterInstances __attribute__ ((aligned(4)));
- /* Holds everything required to create an instance of a door lock */
- typedef struct {
- tsZCL_EndPointDefinition sEndPoint;
- /* Cluster instances */
- tsHA_WindowCoveringDeviceClusterInstances sClusterInstance;
- /* Mandatory server clusters */
- #if (defined CLD_BASIC) && (defined BASIC_SERVER)
- /* Basic Cluster - Server */
- tsCLD_Basic sBasicServerCluster;
- #endif
- #if (defined CLD_IDENTIFY) && (defined IDENTIFY_SERVER)
- /* Identify Cluster - Server */
- tsCLD_Identify sIdentifyServerCluster;
- tsCLD_IdentifyCustomDataStructure sIdentifyServerCustomDataStructure;
- #endif
- #if (defined CLD_SCENES) && (defined SCENES_SERVER)
- /* Scenes Cluster - Server */
- tsCLD_Scenes sScenesServerCluster;
- tsCLD_ScenesCustomDataStructure sScenesServerCustomDataStructure;
- #endif
- #if (defined CLD_GROUPS) && (defined GROUPS_SERVER)
- /* Groups Cluster - Server */
- tsCLD_Groups sGroupsServerCluster;
- tsCLD_GroupsCustomDataStructure sGroupsServerCustomDataStructure;
- #endif
- #if (defined CLD_WINDOWCOVERING) && (defined WINDOWCOVERING_SERVER)
- /* Scenes Cluster - Server */
- tsCLD_WindowCovering sWindowCoveringServerCluster;
- tsCLD_WindowCoveringCustomDataStructure sWindowCoveringCustomDataStructure;
- #endif
- #ifdef CLD_OTA
- /* OTA cluster */
- #ifdef OTA_CLIENT
- tsCLD_AS_Ota sCLD_OTA;
- tsOTA_Common sCLD_OTA_CustomDataStruct;
- #endif
- #ifdef OTA_SERVER
- tsCLD_AS_Ota sCLD_ServerOTA;
- tsOTA_Common sCLD_OTA_ServerCustomDataStruct;
- #endif
- #endif
- } tsHA_WindowCoveringDevice;
- /****************************************************************************/
- /*** Exported Functions ***/
- /****************************************************************************/
- /*
- * @brief Register WindowCovering Endpoint
- * @param uint8 u8EndPointIdentifier
- * @param tfpZCL_ZCLCallBackFunction cbCallback
- * @param tsHA_WindowCoveringDevice *psDeviceInfo
- */
- PUBLIC teZCL_Status eHA_RegisterWindowCoveringEndPoint(
- uint8 u8EndPointIdentifier,
- tfpZCL_ZCLCallBackFunction cbCallBack,
- tsHA_WindowCoveringDevice *psDeviceInfo
- );
- /****************************************************************************/
- /*** External Variables ***/
- /****************************************************************************/
- #if defined __cplusplus
- }
- #endif
- #endif /* WINDOW_COVERING_H_ */
- /****************************************************************************/
- /*** END OF FILE ***/
- /****************************************************************************/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement