Version 1.11
Minor code optimization.
This commit is contained in:
parent
2ed860b78b
commit
4f58a04eae
@ -1,5 +1,5 @@
|
|||||||
name=ZHNetwork
|
name=ZHNetwork
|
||||||
version=1.1
|
version=1.11
|
||||||
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
|
||||||
|
@ -1,31 +1,17 @@
|
|||||||
#include "ZHNetwork.h"
|
#include "ZHNetwork.h"
|
||||||
|
|
||||||
routing_vector_t routingVector;
|
routing_vector_t ZHNetwork::routingVector;
|
||||||
incoming_queue_t queueForIncomingData;
|
incoming_queue_t ZHNetwork::queueForIncomingData;
|
||||||
outgoing_queue_t queueForOutgoingData;
|
outgoing_queue_t ZHNetwork::queueForOutgoingData;
|
||||||
waiting_queue_t queueForRoutingVectorWaiting;
|
waiting_queue_t ZHNetwork::queueForRoutingVectorWaiting;
|
||||||
|
|
||||||
const char *firmware PROGMEM{"1.1"};
|
bool ZHNetwork::criticalProcessSemaphore{false};
|
||||||
const uint8_t broadcastMAC[6]{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
|
bool ZHNetwork::sentMessageSemaphore{false};
|
||||||
|
bool ZHNetwork::confirmReceivingSemaphore{false};
|
||||||
bool criticalProcessSemaphore{false};
|
bool ZHNetwork::confirmReceiving{false};
|
||||||
bool sentMessageSemaphore{false};
|
char ZHNetwork::netName_[20]{0};
|
||||||
bool confirmReceivingSemaphore{false};
|
uint8_t ZHNetwork::localMAC[6]{0};
|
||||||
bool confirmReceiving{false};
|
uint16_t ZHNetwork::lastMessageID[10]{0};
|
||||||
uint8_t localMAC[6]{0};
|
|
||||||
uint8_t numberOfAttemptsToSend{1};
|
|
||||||
uint16_t lastMessageID[10]{0};
|
|
||||||
uint64_t lastMessageSentTime{0};
|
|
||||||
|
|
||||||
work_mode_t workMode_{ESP_NOW};
|
|
||||||
char netName_[20]{0};
|
|
||||||
char apSsid_[32]{"ESP-NOW NODE"};
|
|
||||||
char apPassword_[64]{0};
|
|
||||||
char staSsid_[32]{0};
|
|
||||||
char staPassword_[64]{0};
|
|
||||||
uint8_t maxNumberOfAttempts_{3};
|
|
||||||
uint8_t maxWaitingTimeBetweenTransmissions_{50};
|
|
||||||
uint16_t maxTimeForRoutingInfoWaiting_{500};
|
|
||||||
|
|
||||||
ZHNetwork &ZHNetwork::setOnBroadcastReceivingCallback(on_message_t onBroadcastReceivingCallback)
|
ZHNetwork &ZHNetwork::setOnBroadcastReceivingCallback(on_message_t onBroadcastReceivingCallback)
|
||||||
{
|
{
|
||||||
|
@ -120,6 +120,32 @@ public:
|
|||||||
uint16_t getMaxWaitingTimeForRoutingInfo(void);
|
uint16_t getMaxWaitingTimeForRoutingInfo(void);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
static routing_vector_t routingVector;
|
||||||
|
static incoming_queue_t queueForIncomingData;
|
||||||
|
static outgoing_queue_t queueForOutgoingData;
|
||||||
|
static waiting_queue_t queueForRoutingVectorWaiting;
|
||||||
|
|
||||||
|
static bool criticalProcessSemaphore;
|
||||||
|
static bool sentMessageSemaphore;
|
||||||
|
static bool confirmReceivingSemaphore;
|
||||||
|
static bool confirmReceiving;
|
||||||
|
static uint8_t localMAC[6];
|
||||||
|
static uint16_t lastMessageID[10];
|
||||||
|
static char netName_[20];
|
||||||
|
|
||||||
|
const char *firmware{"1.11"};
|
||||||
|
const uint8_t broadcastMAC[6]{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
|
||||||
|
work_mode_t workMode_{ESP_NOW};
|
||||||
|
char apSsid_[32]{"ESP-NOW NODE"};
|
||||||
|
char apPassword_[64]{0};
|
||||||
|
char staSsid_[32]{0};
|
||||||
|
char staPassword_[64]{0};
|
||||||
|
uint8_t maxNumberOfAttempts_{3};
|
||||||
|
uint8_t maxWaitingTimeBetweenTransmissions_{50};
|
||||||
|
uint8_t numberOfAttemptsToSend{1};
|
||||||
|
uint16_t maxTimeForRoutingInfoWaiting_{500};
|
||||||
|
uint64_t lastMessageSentTime{0};
|
||||||
|
|
||||||
#if defined(ESP8266)
|
#if defined(ESP8266)
|
||||||
static void onDataSent(uint8_t *mac, uint8_t status);
|
static void onDataSent(uint8_t *mac, uint8_t status);
|
||||||
static void onDataReceive(uint8_t *mac, uint8_t *data, uint8_t length);
|
static void onDataReceive(uint8_t *mac, uint8_t *data, uint8_t length);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user