add ability to remove contacts

This commit is contained in:
liamcottle 2025-02-11 17:51:18 +13:00
parent 54df5ed9c3
commit 25cb211060
3 changed files with 16 additions and 1 deletions

View file

@ -18,7 +18,8 @@ class Constants {
SyncNextMessage: 10, // done
SetRadioParams: 11, // done
SetTxPower: 12, // done
SetAdvertLatLon: 14,
SetAdvertLatLon: 14, // done
RemoveContact: 15, // done
}
static ResponseCodes = {

View file

@ -174,6 +174,13 @@ class Device {
await this.sendToRadioFrame(data.toBytes());
}
async sendCommandRemoveContact(pubKey) {
const data = new BufferWriter();
data.writeByte(Constants.CommandCodes.RemoveContact);
data.writeBytes(pubKey); // 32 bytes
await this.sendToRadioFrame(data.toBytes());
}
async readLoop() {
try {
while(true){