mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
* check for 'early receive' ACK
This commit is contained in:
parent
0c3fb918b2
commit
90d1e87ba1
1 changed files with 10 additions and 0 deletions
10
src/Mesh.cpp
10
src/Mesh.cpp
|
|
@ -78,6 +78,16 @@ DispatcherAction Mesh::onRecvPacket(Packet* pkt) {
|
|||
}
|
||||
|
||||
if (pkt->isRouteDirect() && pkt->path_len >= PATH_HASH_SIZE) {
|
||||
// check for 'early received' ACK
|
||||
if (pkt->getPayloadType() == PAYLOAD_TYPE_ACK) {
|
||||
int i = 0;
|
||||
uint32_t ack_crc;
|
||||
memcpy(&ack_crc, &pkt->payload[i], 4); i += 4;
|
||||
if (i <= pkt->payload_len) {
|
||||
onAckRecv(pkt, ack_crc);
|
||||
}
|
||||
}
|
||||
|
||||
if (self_id.isHashMatch(pkt->path) && allowPacketForward(pkt)) {
|
||||
if (pkt->getPayloadType() == PAYLOAD_TYPE_MULTIPART) {
|
||||
return forwardMultipartDirect(pkt);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue