This commit is contained in:
Ben Meadors 2023-01-28 08:17:29 -06:00
parent e01e830c0e
commit 654d38ed3f
2 changed files with 11 additions and 10 deletions

View File

@ -192,12 +192,6 @@ void printBytes(const char *label, const uint8_t *p, size_t numbytes)
*/
ErrorCode Router::send(meshtastic_MeshPacket *p)
{
// Skip the normal ceremony for repeaters
if (config.device.role == meshtastic_Config_DeviceConfig_Role_REPEATER) {
assert(iface);
return iface->send(p);
}
if (p->to == nodeDB.getNodeNum()) {
LOG_ERROR("BUG! send() called with packet destined for local node!\n");
packetPool.release(p);

View File

@ -9,10 +9,17 @@ RepeaterModule *repeaterModule;
bool RepeaterModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_Routing *r)
{
printPacket("Repeater rebroadcasting message", &mp);
meshtastic_MeshPacket *p = const_cast<meshtastic_MeshPacket *>(&mp);
router->send(p);
return true;
printPacket("Repeater observed message", &mp);
router->sniffReceived(&mp, r);
// FIXME - move this to a non promsicious PhoneAPI module?
// Note: we are careful not to send back packets that started with the phone back to the phone
if ((mp.to == NODENUM_BROADCAST || mp.to == nodeDB.getNodeNum()) && (mp.from != 0)) {
printPacket("Delivering rx packet", &mp);
service.handleFromRadio(&mp);
}
return false;
}
meshtastic_MeshPacket *RepeaterModule::allocReply()