mirror of
https://github.com/liquidraver/ZephCore.git
synced 2026-10-16 09:50:02 +00:00
scrub APC and bump to 1.16.6
This commit is contained in:
@@ -32,10 +32,6 @@ void Mesh::maintenanceLoop()
|
||||
Dispatcher::maintenanceLoop();
|
||||
uint32_t now = (uint32_t)_ms->getMillis();
|
||||
_contention.tick(now);
|
||||
#ifdef CONFIG_ZEPHCORE_APC
|
||||
_power_ctrl.tick(now);
|
||||
_radio->setTxPowerReduction(_power_ctrl.getPowerReduction());
|
||||
#endif
|
||||
}
|
||||
|
||||
void Mesh::extendPendingRetransmit(uint32_t hash32)
|
||||
@@ -126,11 +122,6 @@ DispatcherAction Mesh::routeRecvPacket(Packet *packet)
|
||||
packet->setPathHashCount(n + 1);
|
||||
uint32_t h = ContentionTracker::computePacketHash32(packet);
|
||||
_contention.trackRetransmit(h, (uint32_t)_ms->getMillis());
|
||||
#ifdef CONFIG_ZEPHCORE_APC
|
||||
/* We appended our own hash at path index n — true echoes must
|
||||
* carry it there. */
|
||||
_power_ctrl.trackTransmit(h, (uint32_t)_ms->getMillis(), n);
|
||||
#endif
|
||||
uint32_t d = getRetransmitDelay(packet);
|
||||
return ACTION_RETRANSMIT_DELAYED(packet->getPathHashCount(), d); // give priority to closer sources
|
||||
}
|
||||
@@ -266,16 +257,6 @@ DispatcherAction Mesh::onRecvPacket(Packet *pkt)
|
||||
/* Record dupes for contention tracking + reactive backoff */
|
||||
if (pkt->isRouteFlood()) {
|
||||
uint32_t h = ContentionTracker::computePacketHash32(pkt);
|
||||
#ifdef CONFIG_ZEPHCORE_APC
|
||||
{
|
||||
uint8_t hs = pkt->getPathHashSize();
|
||||
uint8_t self_hash[4]; /* max path hash size (path_len bits 7:6 + 1) */
|
||||
self_id.copyHashTo(self_hash, hs);
|
||||
_power_ctrl.recordEcho(h, pkt->_snr, (uint32_t)_ms->getMillis(),
|
||||
pkt->path, pkt->getPathHashCount(), hs,
|
||||
self_hash);
|
||||
}
|
||||
#endif
|
||||
if (_contention.recordDupeIfTracked(h, (uint32_t)_ms->getMillis())) {
|
||||
extendPendingRetransmit(h);
|
||||
} else if (passivelyTrackFloods()) {
|
||||
@@ -558,14 +539,6 @@ void Mesh::sendFlood(Packet *packet, uint32_t delay_millis, uint8_t path_hash_si
|
||||
packet->header |= ROUTE_TYPE_FLOOD;
|
||||
packet->setPathHashSizeAndCount(path_hash_size, 0);
|
||||
_tables->markSeen(packet); /* mark as already sent in case it is rebroadcast back to us */
|
||||
#ifdef CONFIG_ZEPHCORE_APC
|
||||
{
|
||||
uint32_t h = ContentionTracker::computePacketHash32(packet);
|
||||
_power_ctrl.trackTransmit(h, (uint32_t)_ms->getMillis(),
|
||||
PowerController::PATH_POS_ORIGINATED);
|
||||
}
|
||||
#endif
|
||||
|
||||
uint8_t pri;
|
||||
if (packet->getPayloadType() == PAYLOAD_TYPE_PATH) {
|
||||
pri = 2;
|
||||
@@ -594,14 +567,6 @@ void Mesh::sendFlood(Packet *packet, uint16_t *transport_codes, uint32_t delay_m
|
||||
packet->transport_codes[1] = transport_codes[1];
|
||||
packet->setPathHashSizeAndCount(path_hash_size, 0);
|
||||
_tables->markSeen(packet); /* mark as already sent in case it is rebroadcast back to us */
|
||||
#ifdef CONFIG_ZEPHCORE_APC
|
||||
{
|
||||
uint32_t h = ContentionTracker::computePacketHash32(packet);
|
||||
_power_ctrl.trackTransmit(h, (uint32_t)_ms->getMillis(),
|
||||
PowerController::PATH_POS_ORIGINATED);
|
||||
}
|
||||
#endif
|
||||
|
||||
uint8_t pri;
|
||||
if (packet->getPayloadType() == PAYLOAD_TYPE_PATH) {
|
||||
pri = 2;
|
||||
|
||||
Reference in New Issue
Block a user