mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
* refactored the hasSeen(Packet) stuff.
This commit is contained in:
parent
8983584dd8
commit
20fccac2b7
10 changed files with 68 additions and 133 deletions
13
src/Mesh.h
13
src/Mesh.h
|
|
@ -26,6 +26,14 @@ public:
|
|||
uint8_t secret[PUB_KEY_SIZE];
|
||||
};
|
||||
|
||||
/**
|
||||
* An abstraction of the data tables needed to be maintained
|
||||
*/
|
||||
class MeshTables {
|
||||
public:
|
||||
virtual bool hasSeen(const Packet* packet) = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief The next layer in the basic Dispatcher task, Mesh recognises the particular Payload TYPES,
|
||||
* and provides virtual methods for sub-classes on handling incoming, and also preparing outbound Packets.
|
||||
|
|
@ -33,6 +41,7 @@ public:
|
|||
class Mesh : public Dispatcher {
|
||||
RTCClock* _rtc;
|
||||
RNG* _rng;
|
||||
MeshTables* _tables;
|
||||
|
||||
protected:
|
||||
DispatcherAction onRecvPacket(Packet* pkt) override;
|
||||
|
|
@ -117,8 +126,8 @@ protected:
|
|||
*/
|
||||
virtual void onAckRecv(Packet* packet, uint32_t ack_crc) { }
|
||||
|
||||
Mesh(Radio& radio, MillisecondClock& ms, RNG& rng, RTCClock& rtc, PacketManager& mgr)
|
||||
: Dispatcher(radio, ms, mgr), _rng(&rng), _rtc(&rtc)
|
||||
Mesh(Radio& radio, MillisecondClock& ms, RNG& rng, RTCClock& rtc, PacketManager& mgr, MeshTables& tables)
|
||||
: Dispatcher(radio, ms, mgr), _rng(&rng), _rtc(&rtc), _tables(&tables)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue