clean up ack packets

This commit is contained in:
Kevin Hester
2021-02-26 20:36:22 +08:00
parent 0307e4161e
commit 989f52494d
8 changed files with 23 additions and 32 deletions

View File

@@ -38,20 +38,14 @@ void RoutingPlugin::sendAckNak(Routing_Error err, NodeNum to, PacketId idFrom)
{
Routing c = Routing_init_default;
if (!err) {
c.success_id = idFrom;
} else {
c.fail_id = idFrom;
// Also send back the error reason
c.error_reason = err;
}
c.error_reason = err;
auto p = allocDataProtobuf(c);
p->priority = MeshPacket_Priority_ACK;
p->hop_limit = 0; // Assume just immediate neighbors for now
p->to = to;
p->decoded.request_id = idFrom;
DEBUG_MSG("Sending an err=%d,to=0x%x,idFrom=0x%x,id=0x%x\n", err, to, idFrom, p->id);
router->sendLocal(p); // we sometimes send directly to the local node