Skip to content

Commit 12e993d

Browse files
committed
fix(zigbee): Spelling correction
1 parent 7fd9c46 commit 12e993d

File tree

6 files changed

+47
-46
lines changed

6 files changed

+47
-46
lines changed

libraries/Zigbee/examples/Zigbee_Thermostat/Zigbee_Thermostat.ino

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
/* Zigbee thermostat configuration */
3737
#define THERMOSTAT_ENDPOINT_NUMBER 1
38-
#define USE_RECIEVE_TEMP_WITH_SOURCE 1
38+
#define USE_RECEIVE_TEMP_WITH_SOURCE 1
3939
uint8_t button = BOOT_PIN;
4040

4141
ZigbeeThermostat zbThermostat = ZigbeeThermostat(THERMOSTAT_ENDPOINT_NUMBER);
@@ -49,13 +49,13 @@ float sensor_tolerance;
4949
struct tm timeinfo = {}; // Time structure for Time cluster
5050

5151
/****************** Temperature sensor handling *******************/
52-
#if USE_RECIEVE_TEMP_WITH_SOURCE == 0
53-
void recieveSensorTemp(float temperature) {
52+
#if USE_RECEIVE_TEMP_WITH_SOURCE == 0
53+
void receiveSensorTemp(float temperature) {
5454
Serial.printf("Temperature sensor value: %.2f°C\n", temperature);
5555
sensor_temp = temperature;
5656
}
5757
#else
58-
void recieveSensorTempWithSource(float temperature, uint8_t src_endpoint, esp_zb_zcl_addr_t src_address) {
58+
void receiveSensorTempWithSource(float temperature, uint8_t src_endpoint, esp_zb_zcl_addr_t src_address) {
5959
if (src_address.addr_type == ESP_ZB_ZCL_ADDR_TYPE_SHORT) {
6060
Serial.printf("Temperature sensor value: %.2f°C from endpoint %d, address 0x%04x\n", temperature, src_endpoint, src_address.u.short_addr);
6161
} else {
@@ -65,7 +65,7 @@ void recieveSensorTempWithSource(float temperature, uint8_t src_endpoint, esp_zb
6565
}
6666
#endif
6767

68-
void recieveSensorConfig(float min_temp, float max_temp, float tolerance) {
68+
void receiveSensorConfig(float min_temp, float max_temp, float tolerance) {
6969
Serial.printf("Temperature sensor config: min %.2f°C, max %.2f°C, tolerance %.2f°C\n", min_temp, max_temp, tolerance);
7070
sensor_min_temp = min_temp;
7171
sensor_max_temp = max_temp;
@@ -78,15 +78,15 @@ void setup() {
7878
// Init button switch
7979
pinMode(button, INPUT_PULLUP);
8080

81-
// Set callback function for recieving temperature from sensor - Use only one option
82-
#if USE_RECIEVE_TEMP_WITH_SOURCE == 0
83-
zbThermostat.onTempRecieve(recieveSensorTemp); // If you bound only one sensor or you don't need to know the source of the temperature
81+
// Set callback function for receiving temperature from sensor - Use only one option
82+
#if USE_RECEIVE_TEMP_WITH_SOURCE == 0
83+
zbThermostat.onTempReceive(receiveSensorTemp); // If you bound only one sensor or you don't need to know the source of the temperature
8484
#else
85-
zbThermostat.onTempRecieveWithSource(recieveSensorTempWithSource);
85+
zbThermostat.onTempReceiveWithSource(receiveSensorTempWithSource);
8686
#endif
8787

88-
// Set callback function for recieving sensor configuration
89-
zbThermostat.onConfigRecieve(recieveSensorConfig);
88+
// Set callback function for receiving sensor configuration
89+
zbThermostat.onConfigReceive(receiveSensorConfig);
9090

9191
//Optional: set Zigbee device name and model
9292
zbThermostat.setManufacturerAndModel("Espressif", "ZigbeeThermostat");

libraries/Zigbee/keywords.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ setLightColor KEYWORD2
107107
# ZigbeeThermostat
108108
onTempRecieve KEYWORD2
109109
onConfigRecieve KEYWORD2
110+
onTempReceiveWithSource KEYWORD2
110111
getTemperature KEYWORD2
111112
getSensorSettings KEYWORD2
112113
setTemperatureReporting KEYWORD2
@@ -191,4 +192,4 @@ ZIGBEE_DEFAULT_COORDINATOR_CONFIG LITERAL1
191192
ZIGBEE_DEFAULT_RADIO_CONFIG LITERAL1
192193
ZIGBEE_DEFAULT_UART_RCP_RADIO_CONFIG LITERAL1
193194
ZIGBEE_DEFAULT_HOST_CONFIG LITERAL1
194-
ZB_ARRAY_LENTH LITERAL1
195+
ZB_ARRAY_LENGHT LITERAL1

libraries/Zigbee/src/ZigbeeEP.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ char *ZigbeeEP::readManufacturer(uint8_t endpoint, uint16_t short_addr, esp_zb_i
183183
uint16_t attributes[] = {
184184
ESP_ZB_ZCL_ATTR_BASIC_MANUFACTURER_NAME_ID,
185185
};
186-
read_req.attr_number = ZB_ARRAY_LENTH(attributes);
186+
read_req.attr_number = ZB_ARRAY_LENGHT(attributes);
187187
read_req.attr_field = attributes;
188188

189189
if (_read_manufacturer != NULL) {
@@ -221,7 +221,7 @@ char *ZigbeeEP::readModel(uint8_t endpoint, uint16_t short_addr, esp_zb_ieee_add
221221
uint16_t attributes[] = {
222222
ESP_ZB_ZCL_ATTR_BASIC_MODEL_IDENTIFIER_ID,
223223
};
224-
read_req.attr_number = ZB_ARRAY_LENTH(attributes);
224+
read_req.attr_number = ZB_ARRAY_LENGHT(attributes);
225225
read_req.attr_field = attributes;
226226

227227
if (_read_model != NULL) {
@@ -386,7 +386,7 @@ tm ZigbeeEP::getTime(uint8_t endpoint, int32_t short_addr, esp_zb_ieee_addr_t ie
386386
}
387387

388388
uint16_t attributes[] = {ESP_ZB_ZCL_ATTR_TIME_TIME_ID};
389-
read_req.attr_number = ZB_ARRAY_LENTH(attributes);
389+
read_req.attr_number = ZB_ARRAY_LENGHT(attributes);
390390
read_req.attr_field = attributes;
391391

392392
read_req.clusterID = ESP_ZB_ZCL_CLUSTER_ID_TIME;
@@ -438,7 +438,7 @@ int32_t ZigbeeEP::getTimezone(uint8_t endpoint, int32_t short_addr, esp_zb_ieee_
438438
}
439439

440440
uint16_t attributes[] = {ESP_ZB_ZCL_ATTR_TIME_TIME_ZONE_ID};
441-
read_req.attr_number = ZB_ARRAY_LENTH(attributes);
441+
read_req.attr_number = ZB_ARRAY_LENGHT(attributes);
442442
read_req.attr_field = attributes;
443443

444444
read_req.clusterID = ESP_ZB_ZCL_CLUSTER_ID_TIME;

libraries/Zigbee/src/ZigbeeEP.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#define ZB_CMD_TIMEOUT 10000 // 10 seconds
1313
#define OTA_UPGRADE_QUERY_INTERVAL (1 * 60) // 1 hour = 60 minutes
1414

15-
#define ZB_ARRAY_LENTH(arr) (sizeof(arr) / sizeof(arr[0]))
15+
#define ZB_ARRAY_LENGHT(arr) (sizeof(arr) / sizeof(arr[0]))
1616

1717
#define RGB_TO_XYZ(r, g, b, X, Y, Z) \
1818
{ \

libraries/Zigbee/src/ep/ZigbeeThermostat.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ void ZigbeeThermostat::zbAttributeRead(uint16_t cluster_id, const esp_zb_zcl_att
120120
if (cluster_id == ESP_ZB_ZCL_CLUSTER_ID_TEMP_MEASUREMENT) {
121121
if (attribute->id == ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_VALUE_ID && attribute->data.type == ESP_ZB_ZCL_ATTR_TYPE_S16) {
122122
int16_t value = attribute->data.value ? *(int16_t *)attribute->data.value : 0;
123-
if (_on_temp_recieve) {
124-
_on_temp_recieve(zb_s16_to_temperature(value));
123+
if (_on_temp_receive) {
124+
_on_temp_receive(zb_s16_to_temperature(value));
125125
}
126-
if (_on_temp_recieve_with_source) {
127-
_on_temp_recieve_with_source(zb_s16_to_temperature(value), src_endpoint, src_address);
126+
if (_on_temp_receive_with_source) {
127+
_on_temp_receive_with_source(zb_s16_to_temperature(value), src_endpoint, src_address);
128128
}
129129
}
130130
if (attribute->id == ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_MIN_VALUE_ID && attribute->data.type == ESP_ZB_ZCL_ATTR_TYPE_S16) {
@@ -161,7 +161,7 @@ void ZigbeeThermostat::getTemperature() {
161161
read_req.clusterID = ESP_ZB_ZCL_CLUSTER_ID_TEMP_MEASUREMENT;
162162

163163
uint16_t attributes[] = {ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_VALUE_ID};
164-
read_req.attr_number = ZB_ARRAY_LENTH(attributes);
164+
read_req.attr_number = ZB_ARRAY_LENGHT(attributes);
165165
read_req.attr_field = attributes;
166166

167167
log_i("Sending 'read temperature' command");
@@ -179,7 +179,7 @@ void ZigbeeThermostat::getTemperature(uint16_t group_addr) {
179179
read_req.clusterID = ESP_ZB_ZCL_CLUSTER_ID_TEMP_MEASUREMENT;
180180

181181
uint16_t attributes[] = {ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_VALUE_ID};
182-
read_req.attr_number = ZB_ARRAY_LENTH(attributes);
182+
read_req.attr_number = ZB_ARRAY_LENGHT(attributes);
183183
read_req.attr_field = attributes;
184184

185185
log_i("Sending 'read temperature' command to group address 0x%x", group_addr);
@@ -198,7 +198,7 @@ void ZigbeeThermostat::getTemperature(uint8_t endpoint, uint16_t short_addr) {
198198
read_req.clusterID = ESP_ZB_ZCL_CLUSTER_ID_TEMP_MEASUREMENT;
199199

200200
uint16_t attributes[] = {ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_VALUE_ID};
201-
read_req.attr_number = ZB_ARRAY_LENTH(attributes);
201+
read_req.attr_number = ZB_ARRAY_LENGHT(attributes);
202202
read_req.attr_field = attributes;
203203

204204
log_i("Sending 'read temperature' command to endpoint %d, address 0x%x", endpoint, short_addr);
@@ -217,7 +217,7 @@ void ZigbeeThermostat::getTemperature(uint8_t endpoint, esp_zb_ieee_addr_t ieee_
217217
memcpy(read_req.zcl_basic_cmd.dst_addr_u.addr_long, ieee_addr, sizeof(esp_zb_ieee_addr_t));
218218

219219
uint16_t attributes[] = {ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_VALUE_ID};
220-
read_req.attr_number = ZB_ARRAY_LENTH(attributes);
220+
read_req.attr_number = ZB_ARRAY_LENGHT(attributes);
221221
read_req.attr_field = attributes;
222222

223223
log_i(
@@ -239,7 +239,7 @@ void ZigbeeThermostat::getSensorSettings() {
239239
uint16_t attributes[] = {
240240
ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_MIN_VALUE_ID, ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_MAX_VALUE_ID, ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_TOLERANCE_ID
241241
};
242-
read_req.attr_number = ZB_ARRAY_LENTH(attributes);
242+
read_req.attr_number = ZB_ARRAY_LENGHT(attributes);
243243
read_req.attr_field = attributes;
244244

245245
log_i("Sending 'read sensor settings' command");
@@ -253,7 +253,7 @@ void ZigbeeThermostat::getSensorSettings() {
253253
return;
254254
} else {
255255
//Call the callback function when all attributes are read
256-
_on_config_recieve(_min_temp, _max_temp, _tolerance);
256+
_on_config_receive(_min_temp, _max_temp, _tolerance);
257257
}
258258
}
259259

@@ -268,7 +268,7 @@ void ZigbeeThermostat::getSensorSettings(uint16_t group_addr) {
268268
uint16_t attributes[] = {
269269
ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_MIN_VALUE_ID, ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_MAX_VALUE_ID, ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_TOLERANCE_ID
270270
};
271-
read_req.attr_number = ZB_ARRAY_LENTH(attributes);
271+
read_req.attr_number = ZB_ARRAY_LENGHT(attributes);
272272
read_req.attr_field = attributes;
273273

274274
log_i("Sending 'read sensor settings' command to group address 0x%x", group_addr);
@@ -282,7 +282,7 @@ void ZigbeeThermostat::getSensorSettings(uint16_t group_addr) {
282282
return;
283283
} else {
284284
//Call the callback function when all attributes are read
285-
_on_config_recieve(_min_temp, _max_temp, _tolerance);
285+
_on_config_receive(_min_temp, _max_temp, _tolerance);
286286
}
287287
}
288288

@@ -298,7 +298,7 @@ void ZigbeeThermostat::getSensorSettings(uint8_t endpoint, uint16_t short_addr)
298298
uint16_t attributes[] = {
299299
ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_MIN_VALUE_ID, ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_MAX_VALUE_ID, ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_TOLERANCE_ID
300300
};
301-
read_req.attr_number = ZB_ARRAY_LENTH(attributes);
301+
read_req.attr_number = ZB_ARRAY_LENGHT(attributes);
302302
read_req.attr_field = attributes;
303303

304304
log_i("Sending 'read sensor settings' command to endpoint %d, address 0x%x", endpoint, short_addr);
@@ -312,7 +312,7 @@ void ZigbeeThermostat::getSensorSettings(uint8_t endpoint, uint16_t short_addr)
312312
return;
313313
} else {
314314
//Call the callback function when all attributes are read
315-
_on_config_recieve(_min_temp, _max_temp, _tolerance);
315+
_on_config_receive(_min_temp, _max_temp, _tolerance);
316316
}
317317
}
318318

@@ -328,7 +328,7 @@ void ZigbeeThermostat::getSensorSettings(uint8_t endpoint, esp_zb_ieee_addr_t ie
328328
uint16_t attributes[] = {
329329
ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_MIN_VALUE_ID, ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_MAX_VALUE_ID, ESP_ZB_ZCL_ATTR_TEMP_MEASUREMENT_TOLERANCE_ID
330330
};
331-
read_req.attr_number = ZB_ARRAY_LENTH(attributes);
331+
read_req.attr_number = ZB_ARRAY_LENGHT(attributes);
332332
read_req.attr_field = attributes;
333333

334334
log_i(
@@ -345,7 +345,7 @@ void ZigbeeThermostat::getSensorSettings(uint8_t endpoint, esp_zb_ieee_addr_t ie
345345
return;
346346
} else {
347347
//Call the callback function when all attributes are read
348-
_on_config_recieve(_min_temp, _max_temp, _tolerance);
348+
_on_config_receive(_min_temp, _max_temp, _tolerance);
349349
}
350350
}
351351

@@ -367,7 +367,7 @@ void ZigbeeThermostat::setTemperatureReporting(uint16_t min_interval, uint16_t m
367367
.reportable_change = (void*)&report_change,
368368
},
369369
};
370-
report_cmd.record_number = ZB_ARRAY_LENTH(records);
370+
report_cmd.record_number = ZB_ARRAY_LENGHT(records);
371371
report_cmd.record_field = records;
372372

373373
log_i("Sending 'configure reporting' command");
@@ -395,7 +395,7 @@ void ZigbeeThermostat::setTemperatureReporting(uint16_t group_addr, uint16_t min
395395
.reportable_change = (void*)&report_change,
396396
},
397397
};
398-
report_cmd.record_number = ZB_ARRAY_LENTH(records);
398+
report_cmd.record_number = ZB_ARRAY_LENGHT(records);
399399
report_cmd.record_field = records;
400400

401401
log_i("Sending 'configure reporting' command to group address 0x%x", group_addr);
@@ -424,7 +424,7 @@ void ZigbeeThermostat::setTemperatureReporting(uint8_t endpoint, uint16_t short_
424424
.reportable_change = (void*)&report_change,
425425
},
426426
};
427-
report_cmd.record_number = ZB_ARRAY_LENTH(records);
427+
report_cmd.record_number = ZB_ARRAY_LENGHT(records);
428428
report_cmd.record_field = records;
429429

430430
log_i("Sending 'configure reporting' command to endpoint %d, address 0x%x", endpoint, short_addr);
@@ -453,7 +453,7 @@ void ZigbeeThermostat::setTemperatureReporting(uint8_t endpoint, esp_zb_ieee_add
453453
.reportable_change = (void*)&report_change,
454454
},
455455
};
456-
report_cmd.record_number = ZB_ARRAY_LENTH(records);
456+
report_cmd.record_number = ZB_ARRAY_LENGHT(records);
457457
report_cmd.record_field = records;
458458

459459
log_i(

libraries/Zigbee/src/ep/ZigbeeThermostat.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ class ZigbeeThermostat : public ZigbeeEP {
3434
ZigbeeThermostat(uint8_t endpoint);
3535
~ZigbeeThermostat() {}
3636

37-
void onTempRecieve(void (*callback)(float)) {
38-
_on_temp_recieve = callback;
37+
void onTempReceive(void (*callback)(float)) {
38+
_on_temp_receive = callback;
3939
}
40-
void onTempRecieveWithSource(void (*callback)(float, uint8_t, esp_zb_zcl_addr_t)) {
41-
_on_temp_recieve_with_source = callback;
40+
void onTempReceiveWithSource(void (*callback)(float, uint8_t, esp_zb_zcl_addr_t)) {
41+
_on_temp_receive_with_source = callback;
4242
}
43-
void onConfigRecieve(void (*callback)(float, float, float)) {
44-
_on_config_recieve = callback;
43+
void onConfigReceive(void (*callback)(float, float, float)) {
44+
_on_config_receive = callback;
4545
}
4646

4747
void getTemperature();
@@ -64,9 +64,9 @@ class ZigbeeThermostat : public ZigbeeEP {
6464
static ZigbeeThermostat *_instance;
6565
zb_device_params_t *_device;
6666

67-
void (*_on_temp_recieve)(float);
68-
void (*_on_temp_recieve_with_source)(float, uint8_t, esp_zb_zcl_addr_t);
69-
void (*_on_config_recieve)(float, float, float);
67+
void (*_on_temp_receive)(float);
68+
void (*_on_temp_receive_with_source)(float, uint8_t, esp_zb_zcl_addr_t);
69+
void (*_on_config_receive)(float, float, float);
7070
float _min_temp;
7171
float _max_temp;
7272
float _tolerance;

0 commit comments

Comments
 (0)