@@ -246,22 +246,22 @@ void ZigbeeEP::zbReadBasicCluster(const esp_zb_zcl_attribute_t *attribute) {
246
246
/* Basic cluster attributes */
247
247
if (attribute->id == ESP_ZB_ZCL_ATTR_BASIC_MANUFACTURER_NAME_ID && attribute->data .type == ESP_ZB_ZCL_ATTR_TYPE_CHAR_STRING && attribute->data .value ) {
248
248
zbstring_t *zbstr = (zbstring_t *)attribute->data .value ;
249
- std::vector<char > string (zbstr->len + 1 );
250
- memcpy (string .data (), zbstr->data , zbstr->len );
251
- string [zbstr->len ] = ' \0 ' ;
252
- log_i (" Peer Manufacturer is \" %s\" " , string );
249
+ std::vector<char > m_manufacturer (zbstr->len + 1 );
250
+ memcpy (m_manufacturer .data (), zbstr->data , zbstr->len );
251
+ m_manufacturer [zbstr->len ] = ' \0 ' ;
252
+ log_i (" Peer Manufacturer is \" %s\" " , m_manufacturer );
253
253
free (_read_manufacturer); // Free any previously allocated memory
254
- _read_manufacturer = strdup (string .data ()); // Duplicate the string for persistent storage
254
+ _read_manufacturer = strdup (m_manufacturer .data ()); // Duplicate the information for persistent storage
255
255
xSemaphoreGive (lock);
256
256
}
257
257
if (attribute->id == ESP_ZB_ZCL_ATTR_BASIC_MODEL_IDENTIFIER_ID && attribute->data .type == ESP_ZB_ZCL_ATTR_TYPE_CHAR_STRING && attribute->data .value ) {
258
258
zbstring_t *zbstr = (zbstring_t *)attribute->data .value ;
259
- std::vector<char > string (zbstr->len + 1 );
260
- memcpy (string .data (), zbstr->data , zbstr->len );
261
- string [zbstr->len ] = ' \0 ' ;
262
- log_i (" Peer Model is \" %s\" " , string );
259
+ std::vector<char > m_model (zbstr->len + 1 );
260
+ memcpy (m_model .data (), zbstr->data , zbstr->len );
261
+ m_model [zbstr->len ] = ' \0 ' ;
262
+ log_i (" Peer Model is \" %s\" " , m_model );
263
263
free (_read_model); // Free any previously allocated memory
264
- _read_model = strdup (string .data ()); // Duplicate the string for persistent storage
264
+ _read_model = strdup (m_model .data ()); // Duplicate the information for persistent storage
265
265
xSemaphoreGive (lock);
266
266
}
267
267
}
0 commit comments