1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-08-01 03:47:23 +03:00

- Make connectionQueue(), latestTransmissionOutcomes() and latestTransmissionSuccessful() methods static in order to match the underlying data storage.

- Make it possible to transfer elements directly between connectionQueues.

- Add defaultBSSID value.

- Fix bug where encrypted Espnow-connections expired 1 ms too late.

- Add MutexTracker::captureBan() functionality and use it in the espnowReceiveCallbackWrapper method to ensure a consistent mutex environment there.

- Rename acceptRequest to acceptRequests since several requests can be accepted, not just one.

- Reorganize EspnowMeshBackend.cpp.

- Split sendEspnowResponses() method into sendEspnowResponses() and sendPeerRequestConfirmations().

- Add sendStoredEspnowMessages() method to provide the same functionality as the previous version of sendEspnowResponses().

- Add logic for handling peerRequestConfirmations received at the same time as a peer request is being made, to avoid lockups when there are simultaneous cyclic peer requests.

- Add logic for handling simultaneous reciprocal peer requests.

- Include MAC addresses in HMAC calculations for peer requests and use HMAC for all unencrypted peer request messages, to make sure we receive valid MAC combinations.

- Add asserts to ensure ESP-NOW encryption integrity during code changes.

- Add estimatedMaxDuration argument to performEspnowMaintainance and related methods.

- Add methods to EncryptedConnectionData for setting peer MAC.

- Remove createEncryptionRequestMessage function from JsonTranslator since it is not used, to increase clarity.

- Add encryptedConnectionsSoftLimit() and related functionality.

- Add mutex to protect connectionQueue usage during attemptTransmission.

- Add _ongoingPeerRequestMac variable.

- Add reservedEncryptedConnections() method.

- Add TransmissionOutcomesUpdateHook() callback.

- Add constConnectionQueue() method to allow connectionQueue usage while connectionQueue mutex is active.

- Rearrange attemptAutoEncryptingTransmission argument order to increase efficiency.

- Add functionality for serializing the unencrypted ESP-NOW connection.

- Add some constness.

- Improve comments.

- Improve documentation.

- Update keywords.txt.
This commit is contained in:
Anders
2019-10-31 22:25:12 +01:00
parent b0ef9195b5
commit f8ec4f1c72
23 changed files with 981 additions and 533 deletions

View File

@ -67,12 +67,19 @@ public:
/**
* Returns a vector that contains the NetworkInfo for each WiFi network to connect to.
* This vector is unique for each mesh backend.
* This vector is unique for each mesh backend, but NetworkInfo elements can be directly transferred between the vectors as long as both SSID and BSSID are present.
* The connectionQueue vector is cleared before each new scan and filled via the networkFilter callback function once the scan completes.
* WiFi connections will start with connectionQueue[0] and then incrementally proceed to higher vector positions.
* Note that old network indicies often are invalidated whenever a new WiFi network scan occurs.
*
* Since the connectionQueue() is iterated over during transmissions, always use constConnectionQueue() from callbacks other than NetworkFilter.
*/
std::vector<TcpIpNetworkInfo> & connectionQueue();
static std::vector<TcpIpNetworkInfo> & connectionQueue();
/**
* Same as connectionQueue(), but can be called from all callbacks since the returned reference is const.
*/
static const std::vector<TcpIpNetworkInfo> & constConnectionQueue();
/**
* Returns a vector with the TransmissionOutcome for each AP to which a transmission was attempted during the latest attemptTransmission call.
@ -81,7 +88,13 @@ public:
* Connection attempts are indexed in the same order they were attempted.
* Note that old network indicies often are invalidated whenever a new WiFi network scan occurs.
*/
std::vector<TransmissionOutcome> & latestTransmissionOutcomes() override;
static std::vector<TransmissionOutcome> & latestTransmissionOutcomes();
/**
* @return True if latest transmission was successful (i.e. latestTransmissionOutcomes is not empty and all entries have transmissionStatus TS_TRANSMISSION_COMPLETE). False otherwise.
* The result is unique for each mesh backend.
*/
static bool latestTransmissionSuccessful();
/**
* Initialises the node.
@ -116,7 +129,7 @@ public:
/**
* If any clients are connected, accept their requests and call the requestHandler function for each one.
*/
void acceptRequest();
void acceptRequests();
/**
* Get the TCP/IP message that is currently scheduled for transmission.
@ -185,7 +198,7 @@ public:
/**
* Set the timeout to use for transmissions when this TcpIpMeshBackend instance acts as an AP (i.e. when receiving connections from other stations).
* This will affect the timeout of the acceptRequest method.
* This will affect the timeout of the acceptRequests method.
* The timeout is 4 500 ms by default.
* Will also change the setting for the active AP (without an AP restart)
* if this TcpIpMeshBackend instance is the current AP controller.
@ -217,6 +230,11 @@ protected:
*/
static bool _tcpIpTransmissionMutex;
/**
* Will be true when the connectionQueue should not be modified.
*/
static bool _tcpIpConnectionQueueMutex;
/**
* Check if there is an ongoing TCP/IP transmission in the library. Used to avoid interrupting transmissions.
*