Version 1.41

Fixed one bug with generating of message ID.
This commit is contained in:
Alexey Zholtikov 2023-03-05 15:05:40 +03:00
parent 9c3d35e1c3
commit a080869c5c
3 changed files with 8 additions and 3 deletions

View File

@ -1,5 +1,5 @@
name=ZHNetwork name=ZHNetwork
version=1.4 version=1.41
author=Alexey Zholtikov author=Alexey Zholtikov
maintainer=Alexey Zholtikov maintainer=Alexey Zholtikov
sentence=ESP-NOW based Mesh network for ESP8266/ESP32 sentence=ESP-NOW based Mesh network for ESP8266/ESP32

View File

@ -35,7 +35,12 @@ ZHNetwork &ZHNetwork::setOnConfirmReceivingCallback(on_confirm_t onConfirmReceiv
error_code_t ZHNetwork::begin(const char *netName, const bool gateway) error_code_t ZHNetwork::begin(const char *netName, const bool gateway)
{ {
randomSeed(analogRead(0)); #if defined(ESP8266)
randomSeed(os_random());
#endif
#if defined(ESP32)
randomSeed(esp_random());
#endif
if (strlen(netName) >= 1 && strlen(netName) <= 20) if (strlen(netName) >= 1 && strlen(netName) <= 20)
strcpy(netName_, netName); strcpy(netName_, netName);
#ifdef PRINT_LOG #ifdef PRINT_LOG

View File

@ -132,7 +132,7 @@ private:
static char netName_[20]; static char netName_[20];
static char key_[20]; static char key_[20];
const char *firmware{"1.4"}; const char *firmware{"1.41"};
const uint8_t broadcastMAC[6]{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; const uint8_t broadcastMAC[6]{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
uint8_t maxNumberOfAttempts_{3}; uint8_t maxNumberOfAttempts_{3};
uint8_t maxWaitingTimeBetweenTransmissions_{50}; uint8_t maxWaitingTimeBetweenTransmissions_{50};