implement import contact command

This commit is contained in:
liamcottle 2025-02-15 21:39:29 +13:00
parent df3c032acd
commit 381a1b9d17
3 changed files with 17 additions and 0 deletions

View file

@ -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

View file

@ -29,6 +29,7 @@ class Constants {
RemoveContact: 15,
ShareContact: 16,
ExportContact: 17,
ImportContact: 18,
}
static ResponseCodes = {