@@ -772,33 +772,34 @@ typedef struct esp_zb_metering_get_sampled_data_cmd_s {
772
772
/**
773
773
* @brief The Zigbee ZCL custom cluster command struct
774
774
*
775
- * @note Support only u8, s8, u16, s16, u32, s32, string data types.
776
- *
777
775
* @note For string data type, the first byte should be the length of string.
776
+ * For array, array16, array32, and long string data types, the first 2 bytes should represent the number of elements in the array.
778
777
*
779
778
*/
780
- typedef struct esp_zb_zcl_custom_cluster_cmd_req_s {
779
+ typedef struct esp_zb_zcl_custom_cluster_cmd_s {
781
780
esp_zb_zcl_basic_cmd_t zcl_basic_cmd ; /*!< Basic command info */
782
781
esp_zb_zcl_address_mode_t address_mode ; /*!< APS addressing mode constants refer to esp_zb_zcl_address_mode_t */
783
- void * value ; /*!< Pointer to value */
784
- esp_zb_zcl_attr_type_t data_type ; /*!< Data type to be used */
785
782
uint16_t profile_id ; /*!< Profile id */
786
783
uint16_t cluster_id ; /*!< Cluster id */
787
784
uint16_t custom_cmd_id ; /*!< Custom command id */
788
- } esp_zb_zcl_custom_cluster_cmd_req_t ;
785
+ esp_zb_zcl_cmd_direction_t direction ; /*!< Direction of command */
786
+ struct {
787
+ esp_zb_zcl_attr_type_t type ; /*!< The type of custom data, refer to esp_zb_zcl_attr_type_t */
788
+ void * value ; /*!< The value of custom data */
789
+ } data ; /*!< The custom data */
790
+ } esp_zb_zcl_custom_cluster_cmd_t ;
789
791
790
792
/**
791
- * @brief The Zigbee ZCL custom cluster command response struct
793
+ * @brief The Zigbee ZCL custom cluster request command struct
792
794
*
793
795
*/
794
- typedef struct esp_zb_zcl_custom_cluster_cmd_resp_s {
795
- esp_zb_zcl_basic_cmd_t zcl_basic_cmd ; /*!< Basic command info */
796
- esp_zb_zcl_address_mode_t address_mode ; /*!< APS addressing mode constants refer to esp_zb_zcl_address_mode_t */
797
- uint8_t status ; /*!< Status value */
798
- uint16_t profile_id ; /*!< Profile id */
799
- uint16_t cluster_id ; /*!< Cluster id */
800
- uint16_t custom_cmd_resp_id ; /*!< Custom command response id */
801
- } esp_zb_zcl_custom_cluster_cmd_resp_t ;
796
+ typedef esp_zb_zcl_custom_cluster_cmd_t esp_zb_zcl_custom_cluster_cmd_req_t ;
797
+
798
+ /**
799
+ * @brief The Zigbee ZCL custom cluster response command struct
800
+ *
801
+ */
802
+ typedef esp_zb_zcl_custom_cluster_cmd_t esp_zb_zcl_custom_cluster_cmd_resp_t ;
802
803
803
804
/*********************** User Message *****************************/
804
805
/**
@@ -1479,6 +1480,8 @@ typedef struct esp_zb_zcl_privilege_command_message_s {
1479
1480
/**
1480
1481
* @brief The Zigbee zcl customized cluster message struct
1481
1482
*
1483
+ * @note For string data type, the first byte should be the length of string.
1484
+ * For array, array16, array32, and long string data types, the first 2 bytes should represent the number of elements in the array.
1482
1485
*/
1483
1486
typedef struct esp_zb_zcl_custom_cluster_command_message_s {
1484
1487
esp_zb_zcl_cmd_info_t info ; /*!< The basic information of customized cluster command message that refers to esp_zb_zcl_report_attr_message_t */
@@ -2025,15 +2028,17 @@ void esp_zb_zcl_metering_get_sampled_data_cmd_req(esp_zb_metering_get_sampled_da
2025
2028
/**
2026
2029
* @brief Send custom cluster command request
2027
2030
*
2028
- * @param[in] cmd_req pointer to the send custom cluster command request @ref esp_zb_zcl_custom_cluster_cmd_req_s
2031
+ * @param[in] cmd_req pointer to the send custom cluster command request, refer to esp_zb_zcl_custom_cluster_cmd_req_t
2029
2032
*
2030
2033
*/
2031
2034
void esp_zb_zcl_custom_cluster_cmd_req (esp_zb_zcl_custom_cluster_cmd_req_t * cmd_req );
2032
2035
2033
2036
/**
2034
2037
* @brief Send custom cluster command response
2035
2038
*
2036
- * @param[in] cmd_req pointer to the send custom cluster command response @ref esp_zb_zcl_custom_cluster_cmd_resp_s
2039
+ * @note The custom response should align in the same direction as the custom request when providing a reply.
2040
+ *
2041
+ * @param[in] cmd_req pointer to the send custom cluster command request, refer to esp_zb_zcl_custom_cluster_cmd_resp_t
2037
2042
*
2038
2043
*/
2039
2044
void esp_zb_zcl_custom_cluster_cmd_resp (esp_zb_zcl_custom_cluster_cmd_resp_t * cmd_req );
0 commit comments