File tree 1 file changed +7
-6
lines changed
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -41,11 +41,12 @@ typedef enum {
41
41
/* Zigbee End Device Class */
42
42
class ZigbeeEP {
43
43
public:
44
+ // constants and limits
45
+ static constexpr size_t ZB_MAX_NAME_LENGTH = 32 ;
46
+
47
+ // constructors and destructor
44
48
ZigbeeEP (uint8_t endpoint = 10 );
45
- ~ZigbeeEP () {
46
- free (_read_manufacturer);
47
- free (_read_model);
48
- }
49
+ ~ZigbeeEP () {}
49
50
50
51
// Set ep config and cluster list
51
52
void setEpConfig (esp_zb_endpoint_config_t ep_config, esp_zb_cluster_list_t *cluster_list) {
@@ -141,8 +142,8 @@ class ZigbeeEP {
141
142
}
142
143
143
144
private:
144
- char * _read_manufacturer;
145
- char * _read_model;
145
+ char _read_manufacturer[ZB_MAX_NAME_LENGTH + 1 ]; // + 1 for the extra '\0'
146
+ char _read_model[ZB_MAX_NAME_LENGTH + 1 ]; // + 1 for the extra '\0'
146
147
void (*_on_identify)(uint16_t time);
147
148
time_t _read_time;
148
149
int32_t _read_timezone;
You can’t perform that action at this time.
0 commit comments