Merge pull request #156 from mc-hamster/master

Update on the delayed enum in meshpacket
This commit is contained in:
Jm Casler 2021-12-27 10:32:41 -08:00 committed by GitHub
commit 76f9c7ad19
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -129,6 +129,43 @@ Story: The Store & Forward Router sends a periodic message onto the network. Thi
* * * StoreAndForward.heartbeat.Period = 120 // Expect a heartbeat every 2 minutes
* * * StoreAndForward.heartbeat.Secondary = false // If true, this is a secondary "backup" S&F node. Will be (eventually) used for router election in the event there are multiple S&F Routers.
## Meshpacket
To support functionality of Store and Forward, a new enum has been added to the MeshPacket.
```
typedef enum _MeshPacket_Delayed {
MeshPacket_Delayed_NO_DELAY = 0,
MeshPacket_Delayed_DELAYED_BROADCAST = 1,
MeshPacket_Delayed_DELAYED_DIRECT = 2
} MeshPacket_Delayed;
```
* NO_DELAY - The packet was set in real time. Store and Forward had no hand in this message. This is the default case.
* DELAYED_BROADCAST - This is a delayed message. The 'to' of the packet has been directed at a named user but was previously a broadcast packet.
* DELAYED_DIRECT - This is a delayed message. The 'to' of the packet has been directed at a named user but was previously a direct packet.
As a reminder, broadcast messages are messages where the "to" of a payload is directed at NODENUM_BROADCAST or (0xFFFFFFFF).
Example Cases:
* Real time :: BROADCAST
* * Delayed = MeshPacket_Delayed_NO_DELAY
* * From: Ann
* * To: BROADCAST
* Real time :: Direct
* * Delayed = MeshPacket_Delayed_NO_DELAY
* * From: Ann
* * To: Bob
* Delayed :: BROADCAST
* * Delayed = MeshPacket_Delayed_DELAYED_BROADCAST
* * From: Ann
* * To: Bob
* Delayed :: Direct
* * Delayed = MeshPacket_Delayed_DELAYED_DIRECT
* * From: Ann
* * To: Bob
## Developer TODO
Not necessarily in this order: