mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-08 17:02:26 +03:00
- Split most of the EspnowMeshBackend code into utility files and the new ConditionalPrinter, EspnowDatabase, EspnowConnectionManager, EspnowTransmitter and EspnowEncryptionBroker classes.
- Improve mutex handling. - Move verifyEncryptionRequestHmac function from JsonTranslator to EspnowEncryptionBroker. - Remove UtilityMethods.cpp.
This commit is contained in:
@ -45,4 +45,17 @@ namespace MeshUtilityFunctions
|
||||
{
|
||||
return (((uint64_t)RANDOM_REG32 << 32) | (uint64_t)RANDOM_REG32);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T *getMapValue(std::map<uint64_t, T> &mapIn, const uint64_t keyIn)
|
||||
{
|
||||
typename std::map<uint64_t, T>::iterator mapIterator = mapIn.find(keyIn);
|
||||
|
||||
if(mapIterator != mapIn.end())
|
||||
{
|
||||
return &mapIterator->second;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user