Skip to content

Commit 514836f

Browse files
authored
fix(esp_now): Return -1 on error
1 parent 018faef commit 514836f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libraries/ESP_NOW/src/ESP32_NOW.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ int ESP_NOW_Class::getEncryptedPeerCount() const {
261261
int ESP_NOW_Class::getMaxDataLen() const {
262262
if (max_data_len == 0) {
263263
log_e("ESP-NOW not initialized. Please call begin() first to get the max data length.");
264-
return -ESP_ERR_ESPNOW_NOT_INIT;
264+
return -1;
265265
}
266266

267267
return max_data_len;
@@ -270,7 +270,7 @@ int ESP_NOW_Class::getMaxDataLen() const {
270270
int ESP_NOW_Class::getVersion() const {
271271
if (version == 0) {
272272
log_e("ESP-NOW not initialized. Please call begin() first to get the version.");
273-
return -ESP_ERR_ESPNOW_NOT_INIT;
273+
return -1;
274274
}
275275

276276
return version;

0 commit comments

Comments
 (0)