mirror of
https://github.com/meshcore-dev/meshcore.js.git
synced 2026-04-20 22:13:49 +00:00
add ability to reset path
This commit is contained in:
parent
8bf65ea11f
commit
fba9eb63c7
3 changed files with 15 additions and 0 deletions
|
|
@ -68,6 +68,9 @@
|
|||
<button @click="sendCommandSetTxPower" class="border border-gray-500 px-2 bg-gray-100 hover:bg-gray-200 rounded">
|
||||
SetTxPower
|
||||
</button>
|
||||
<button @click="sendCommandResetPath" class="border border-gray-500 px-2 bg-gray-100 hover:bg-gray-200 rounded">
|
||||
ResetPath
|
||||
</button>
|
||||
<button @click="sendCommandSendTxtMsg" class="border border-gray-500 px-2 bg-gray-100 hover:bg-gray-200 rounded">
|
||||
SendTxtMsg
|
||||
</button>
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ class Constants {
|
|||
SyncNextMessage: 10,
|
||||
SetRadioParams: 11,
|
||||
SetTxPower: 12,
|
||||
ResetPath: 13,
|
||||
SetAdvertLatLon: 14,
|
||||
RemoveContact: 15,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue