Advertisement
tranthudo

window_covering.h

Jul 2nd, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 4.77 KB | None | 0 0
  1. /*
  2.  * window_covering.h
  3.  *
  4.  *  Created on: Jun 1, 2019
  5.  *      Author: TrungTQ9
  6.  */
  7.  
  8. #ifndef WINDOW_COVERING_H_
  9. #define WINDOW_COVERING_H_
  10.  
  11. #include <jendefs.h>
  12. #include "zcl.h"
  13. #include "zcl_options.h"
  14. #include "Basic.h"
  15. #include "Identify.h"
  16. #include "Groups.h"
  17. #include "Scenes.h"
  18. #include "WindowCovering.h"
  19. #ifdef CLD_OTA
  20. #include "OTA.h"
  21. #endif
  22.  
  23. #if defined __cplusplus
  24. extern "C" {
  25. #endif
  26.  
  27. /****************************************************************************/
  28. /***        Macro Definitions                                             ***/
  29. /****************************************************************************/
  30. #define CLOSURES_WINDOW_COVERING_DEVICE_ID                      0x0202
  31.  
  32. /****************************************************************************/
  33. /***        Type Definitions                                              ***/
  34. /****************************************************************************/
  35. /* Holds cluster instances */
  36. typedef struct {
  37.     /* All HA devices have 2 mandatory clusters - Basic(server) and Identify(server) */
  38. #if (defined CLD_BASIC) && (defined BASIC_SERVER)
  39.     tsZCL_ClusterInstance sBasicServer;
  40. #endif
  41.  
  42. #if (defined CLD_IDENTIFY) && (defined IDENTIFY_SERVER)
  43.     tsZCL_ClusterInstance sIdentifyServer;
  44. #endif
  45.  
  46. #if (defined CLD_SCENES) && (defined SCENES_SERVER)
  47.     tsZCL_ClusterInstance sScenesServer;
  48. #endif
  49.  
  50. #if (defined CLD_GROUPS) && (defined GROUPS_SERVER)
  51.     tsZCL_ClusterInstance sGroupsServer;
  52. #endif
  53.  
  54. #if (defined CLD_WINDOWCOVERING) && (defined WINDOWCOVERING_SERVER)
  55.     tsZCL_ClusterInstance sWindowCoveringServer;
  56. #endif
  57.  
  58. #ifdef CLD_OTA
  59.     #ifdef OTA_CLIENT
  60.     /* Add  cluster instance for the OTA cluster */
  61.     tsZCL_ClusterInstance sOTAClient;
  62.     #endif
  63.     #ifdef OTA_SERVER
  64.     /* Add  server instance for the OTA cluster */
  65.     tsZCL_ClusterInstance sOTAServer;    
  66.     #endif
  67. #endif
  68.  
  69. } tsHA_WindowCoveringDeviceClusterInstances __attribute__ ((aligned(4)));
  70.  
  71.  
  72. /* Holds everything required to create an instance of a door lock */
  73. typedef struct {
  74.     tsZCL_EndPointDefinition sEndPoint;
  75.  
  76.     /* Cluster instances */
  77.     tsHA_WindowCoveringDeviceClusterInstances sClusterInstance;
  78.  
  79.     /* Mandatory server clusters */
  80. #if (defined CLD_BASIC) && (defined BASIC_SERVER)
  81.     /* Basic Cluster - Server */
  82.     tsCLD_Basic sBasicServerCluster;
  83. #endif
  84.  
  85. #if (defined CLD_IDENTIFY) && (defined IDENTIFY_SERVER)
  86.     /* Identify Cluster - Server */
  87.     tsCLD_Identify sIdentifyServerCluster;
  88.     tsCLD_IdentifyCustomDataStructure sIdentifyServerCustomDataStructure;
  89. #endif
  90.  
  91. #if (defined CLD_SCENES) && (defined SCENES_SERVER)
  92.     /* Scenes Cluster - Server */
  93.     tsCLD_Scenes sScenesServerCluster;
  94.     tsCLD_ScenesCustomDataStructure sScenesServerCustomDataStructure;
  95. #endif
  96.  
  97. #if (defined CLD_GROUPS) && (defined GROUPS_SERVER)
  98.     /* Groups Cluster - Server */
  99.     tsCLD_Groups sGroupsServerCluster;
  100.     tsCLD_GroupsCustomDataStructure sGroupsServerCustomDataStructure;
  101. #endif
  102.  
  103. #if (defined CLD_WINDOWCOVERING) && (defined WINDOWCOVERING_SERVER)
  104.     /* Scenes Cluster - Server */
  105.     tsCLD_WindowCovering sWindowCoveringServerCluster;
  106.     tsCLD_WindowCoveringCustomDataStructure sWindowCoveringCustomDataStructure;
  107. #endif
  108.  
  109. #ifdef CLD_OTA
  110.     /* OTA cluster */
  111.     #ifdef OTA_CLIENT
  112.         tsCLD_AS_Ota sCLD_OTA;
  113.         tsOTA_Common sCLD_OTA_CustomDataStruct;
  114.     #endif
  115.    
  116.     #ifdef OTA_SERVER
  117.         tsCLD_AS_Ota sCLD_ServerOTA;    
  118.         tsOTA_Common sCLD_OTA_ServerCustomDataStruct;
  119.     #endif
  120. #endif
  121.  
  122. } tsHA_WindowCoveringDevice;
  123.  
  124. /****************************************************************************/
  125. /***        Exported Functions                                            ***/
  126. /****************************************************************************/
  127.  
  128. /*
  129.  * @brief   Register WindowCovering Endpoint
  130.  * @param   uint8                       u8EndPointIdentifier
  131.  * @param   tfpZCL_ZCLCallBackFunction  cbCallback
  132.  * @param   tsHA_WindowCoveringDevice   *psDeviceInfo
  133.  */
  134. PUBLIC teZCL_Status eHA_RegisterWindowCoveringEndPoint(
  135.     uint8                       u8EndPointIdentifier,
  136.     tfpZCL_ZCLCallBackFunction  cbCallBack,
  137.     tsHA_WindowCoveringDevice   *psDeviceInfo
  138. );
  139.  
  140. /****************************************************************************/
  141. /***        External Variables                                            ***/
  142. /****************************************************************************/
  143.  
  144. #if defined __cplusplus
  145. }
  146. #endif
  147.  
  148. #endif /* WINDOW_COVERING_H_ */
  149.  
  150. /****************************************************************************/
  151. /***        END OF FILE                                                   ***/
  152. /****************************************************************************/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement