mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-03-30 17:05:52 +00:00
* companion radio: new CMD_EXPORT_CONTACT, CMD_IMPORT_CONTACT
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user