add ability to set advert lat lon

This commit is contained in:
liamcottle 2025-02-11 17:45:53 +13:00
parent 581e159f0d
commit 54df5ed9c3
3 changed files with 17 additions and 0 deletions

View file

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

View file

@ -166,6 +166,14 @@ class Device {
await this.sendToRadioFrame(data.toBytes());
}
async sendCommandSetAdvertLatLon(lat, lon) {
const data = new BufferWriter();
data.writeByte(Constants.CommandCodes.SetAdvertLatLon);
data.writeUInt32LE(lat);
data.writeUInt32LE(lon);
await this.sendToRadioFrame(data.toBytes());
}
async readLoop() {
try {
while(true){