1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-24 19:42:27 +03:00

- Rework ExpiringTimeTracker to be based on PolledTimeout.

- Ensure espnowDelay and floodingMeshDelay always performs maintenance.

- Rework MutexTracker to use shared_ptr.

- Change enums to enum class.

- Change typedef to using.

- Add HeapMonitor class.

- Make _messageIDs be a map instead of an unordered_map to reduce heap usage.

- Use the possibly broken wifi_country ESP8266 API to check for legal WiFi channels when setting WiFi channels.

- Make MessageData, RequestData and ResponseData contain a TimeTracker rather than inherit from TimeTracker.

- Add deprecated attribute to TransmissionResult.

- Remove superfluous elses.

- Reduce cyclomatic complexity.

- Change postfix ++ and -- to prefix.

- Generalize getEncryptedConnectionIterator method.

- Increase code NRVO compatibility.

- Change _connectionAttemptTimeoutMs type from int32_t to uint32_t.

- Add deprecated attribute to ESP8266WiFiMesh.

- Add some constness to TypeConversionFunctions.

- Move base36 arrays to PROGMEM in TypeConversionFunctions.cpp.

- Add deprecated atttribute to SHA1 and MD5 hashes.

- Remove _warningsEnabled in CryptoInterface since this has been replaced by the deprecated attribute.

- Prefix all TypeConversion getters with "get".

- Improve comments.

- Fix merge conflict.
This commit is contained in:
Anders
2020-03-05 15:30:20 +01:00
parent a49f047096
commit 16801f3dac
38 changed files with 924 additions and 679 deletions

View File

@ -26,11 +26,11 @@ namespace TypeCast = MeshTypeConversionFunctions;
MeshBackendBase *MeshBackendBase::apController = nullptr;
bool MeshBackendBase::_scanMutex = false;
std::shared_ptr<bool> MeshBackendBase::_scanMutex = std::make_shared<bool>(false);
bool MeshBackendBase::_printWarnings = true;
MeshBackendBase::MeshBackendBase(requestHandlerType requestHandler, responseHandlerType responseHandler, networkFilterType networkFilter, mesh_backend_t classType)
MeshBackendBase::MeshBackendBase(requestHandlerType requestHandler, responseHandlerType responseHandler, networkFilterType networkFilter, MeshBackendType classType)
{
setRequestHandler(requestHandler);
setResponseHandler(responseHandler);
@ -43,12 +43,12 @@ MeshBackendBase::~MeshBackendBase()
deactivateControlledAP();
}
void MeshBackendBase::setClassType(mesh_backend_t classType)
void MeshBackendBase::setClassType(MeshBackendType classType)
{
_classType = classType;
}
mesh_backend_t MeshBackendBase::getClassType() {return _classType;}
MeshBackendType MeshBackendBase::getClassType() {return _classType;}
void MeshBackendBase::activateAP()
{
@ -115,7 +115,9 @@ bool MeshBackendBase::isAPController()
void MeshBackendBase::setWiFiChannel(uint8 newWiFiChannel)
{
assert(1 <= newWiFiChannel && newWiFiChannel <= 13);
wifi_country_t wifiCountry;
wifi_get_country(&wifiCountry); // Note: Should return 0 on success and -1 on failure, but always seems to return 1. Possibly broken API. Channels 1 to 13 are the default limits.
assert(wifiCountry.schan <= newWiFiChannel && newWiFiChannel <= wifiCountry.schan + wifiCountry.nchan - 1);
_meshWiFiChannel = newWiFiChannel;
@ -248,10 +250,10 @@ bool MeshBackendBase::latestTransmissionSuccessfulBase(const std::vector<Transmi
{
if(latestTransmissionOutcomes.empty())
return false;
else
for(const TransmissionOutcome &transmissionOutcome : latestTransmissionOutcomes)
if(transmissionOutcome.transmissionStatus() != TS_TRANSMISSION_COMPLETE)
return false;
for(const TransmissionOutcome &transmissionOutcome : latestTransmissionOutcomes)
if(transmissionOutcome.transmissionStatus() != TransmissionStatusType::TRANSMISSION_COMPLETE)
return false;
return true;
}