mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-07 03:59:37 +00:00
fixed missing bytes from radio packet
This commit is contained in:
parent
f9c7471c31
commit
5755ebaafc
@ -15,6 +15,22 @@ ErrorCode FloodingRouter::send(meshtastic_MeshPacket *p)
|
|||||||
// Add any messages _we_ send to the seen message list (so we will ignore all retransmissions we see)
|
// Add any messages _we_ send to the seen message list (so we will ignore all retransmissions we see)
|
||||||
wasSeenRecently(p); // FIXME, move this to a sniffSent method
|
wasSeenRecently(p); // FIXME, move this to a sniffSent method
|
||||||
|
|
||||||
|
// -- START coverage filter population --
|
||||||
|
// If this is a floodable packet (for example, has non-zero hop_limit and ID),
|
||||||
|
// we can add our coverage.
|
||||||
|
if (p->id != 0 && p->hop_limit > 0) {
|
||||||
|
CoverageFilter coverage;
|
||||||
|
// Is there anything upstream of this? I think not, but if so, we need to merge coverage.
|
||||||
|
// loadCoverageFilterFromPacket(p, coverage);
|
||||||
|
|
||||||
|
// Add our coverage (neighbors, etc.) so they are in the filter from the get-go
|
||||||
|
mergeMyCoverage(coverage);
|
||||||
|
|
||||||
|
// Save the coverage bits into the packet:
|
||||||
|
storeCoverageFilterInPacket(coverage, p);
|
||||||
|
}
|
||||||
|
// -- END coverage filter population --
|
||||||
|
|
||||||
return Router::send(p);
|
return Router::send(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -634,6 +634,15 @@ size_t RadioInterface::beginSending(meshtastic_MeshPacket *p)
|
|||||||
p->hop_limit | (p->want_ack ? PACKET_FLAGS_WANT_ACK_MASK : 0) | (p->via_mqtt ? PACKET_FLAGS_VIA_MQTT_MASK : 0);
|
p->hop_limit | (p->want_ack ? PACKET_FLAGS_WANT_ACK_MASK : 0) | (p->via_mqtt ? PACKET_FLAGS_VIA_MQTT_MASK : 0);
|
||||||
radioBuffer.header.flags |= (p->hop_start << PACKET_FLAGS_HOP_START_SHIFT) & PACKET_FLAGS_HOP_START_MASK;
|
radioBuffer.header.flags |= (p->hop_start << PACKET_FLAGS_HOP_START_SHIFT) & PACKET_FLAGS_HOP_START_MASK;
|
||||||
|
|
||||||
|
// Coverage filter is 16 bytes, but p->coverage_filter.size might be 0..16.
|
||||||
|
// Usually, you set p->coverage_filter.size = 16 if you want to transmit.
|
||||||
|
radioBuffer.header.coverage_filter.fill(0); // Clear first, in case size < 16
|
||||||
|
if (p->coverage_filter.size > 0) {
|
||||||
|
memcpy(radioBuffer.header.coverage_filter.data(),
|
||||||
|
p->coverage_filter.bytes,
|
||||||
|
std::min((size_t)p->coverage_filter.size, (size_t)BLOOM_FILTER_SIZE_BYTES));
|
||||||
|
}
|
||||||
|
|
||||||
// if the sender nodenum is zero, that means uninitialized
|
// if the sender nodenum is zero, that means uninitialized
|
||||||
assert(radioBuffer.header.from);
|
assert(radioBuffer.header.from);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user