mirror of
https://github.com/meshcore-dev/meshcore.js.git
synced 2026-04-20 22:13:49 +00:00
add ability to remove contacts
This commit is contained in:
parent
54df5ed9c3
commit
25cb211060
3 changed files with 16 additions and 1 deletions
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue