mirror of
https://github.com/meshcore-dev/meshcore.js.git
synced 2026-04-20 22:13:49 +00:00
implement import contact command
This commit is contained in:
parent
df3c032acd
commit
381a1b9d17
3 changed files with 17 additions and 0 deletions
|
|
@ -165,6 +165,13 @@ class Connection extends EventEmitter {
|
|||
await this.sendToRadioFrame(data.toBytes());
|
||||
}
|
||||
|
||||
async sendCommandImportContact(advertPacketBytes) {
|
||||
const data = new BufferWriter();
|
||||
data.writeByte(Constants.CommandCodes.ImportContact);
|
||||
data.writeBytes(advertPacketBytes); // raw advert packet bytes
|
||||
await this.sendToRadioFrame(data.toBytes());
|
||||
}
|
||||
|
||||
onFrameReceived(frame) {
|
||||
|
||||
// emit received frame
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ class Constants {
|
|||
RemoveContact: 15,
|
||||
ShareContact: 16,
|
||||
ExportContact: 17,
|
||||
ImportContact: 18,
|
||||
}
|
||||
|
||||
static ResponseCodes = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue