diff --git a/index.html b/index.html index 1943a29..4ac9f1e 100644 --- a/index.html +++ b/index.html @@ -68,6 +68,9 @@ + @@ -139,6 +142,10 @@ const txPower = 22; await this.device.sendCommandSetTxPower(txPower); }, + async sendCommandResetPath() { + const publicKey = new Uint8Array([244, 231, 60, 250, 245, 218, 131, 156, 156, 98, 130, 39, 222, 43, 123, 147, 98, 200, 218, 251, 242, 89, 111, 108, 25, 191, 127, 151, 222, 192, 233, 177]); + await this.device.sendCommandResetPath(publicKey); + }, async sendCommandSetRadioParams() { const radioFreq = 917375; const radioBw = 250000; diff --git a/src/constants.js b/src/constants.js index fc8315e..756c903 100644 --- a/src/constants.js +++ b/src/constants.js @@ -18,6 +18,7 @@ class Constants { SyncNextMessage: 10, SetRadioParams: 11, SetTxPower: 12, + ResetPath: 13, SetAdvertLatLon: 14, RemoveContact: 15, } diff --git a/src/device.js b/src/device.js index 17b8d3a..d14e3ea 100644 --- a/src/device.js +++ b/src/device.js @@ -166,6 +166,13 @@ class Device { await this.sendToRadioFrame(data.toBytes()); } + async sendCommandResetPath(pubKey) { + const data = new BufferWriter(); + data.writeByte(Constants.CommandCodes.ResetPath); + data.writeBytes(pubKey); // 32 bytes + await this.sendToRadioFrame(data.toBytes()); + } + async sendCommandSetAdvertLatLon(lat, lon) { const data = new BufferWriter(); data.writeByte(Constants.CommandCodes.SetAdvertLatLon);