mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
* companion radio: new CMD_EXPORT_CONTACT, CMD_IMPORT_CONTACT
This commit is contained in:
parent
65580c76d0
commit
a2fa4caa3f
4 changed files with 64 additions and 12 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue