* companion radio: new CMD_EXPORT_CONTACT, CMD_IMPORT_CONTACT

This commit is contained in:
Scott Powell
2025-02-15 15:57:02 +11:00
parent 65580c76d0
commit a2fa4caa3f
4 changed files with 64 additions and 12 deletions

View File

@@ -200,17 +200,8 @@ class MyMesh : public BaseChatMesh, ContactVisitor {
if (len % 2 == 0) {
len >>= 1; // halve, for num bytes
if (mesh::Utils::fromHex(tmp_buf, len, command)) {
auto pkt = obtainNewPacket();
if (pkt) {
if (pkt->readFrom(tmp_buf, len) && pkt->getPayloadType() == PAYLOAD_TYPE_ADVERT) {
pkt->header |= ROUTE_TYPE_FLOOD; // simulate it being received flood-mode
onRecvPacket(pkt); // loop-back, as if received over radio
releasePacket(pkt); // undo the obtainNewPacket()
return;
} else {
releasePacket(pkt); // undo the obtainNewPacket()
}
}
importContact(tmp_buf, len);
return;
}
}
}