@meshtastic/meshtasticjs
Advanced tools
Comparing version 2.0.13-5 to 2.0.13-6
@@ -5,2 +5,3 @@ import { Logger } from "tslog"; | ||
import { Queue } from "./utils/queue.js"; | ||
import { XModem } from "./utils/xmodem.js"; | ||
/** Base class for connection methods to extend */ | ||
@@ -28,2 +29,3 @@ export declare abstract class IMeshDevice { | ||
events: EventSystem; | ||
XModem: XModem; | ||
constructor(configId?: number); | ||
@@ -94,15 +96,5 @@ /** Abstract method that writes data to the radio */ | ||
clearChannel(index: number): Promise<number>; | ||
/** | ||
* Confirms the currently set channels, and prevents changes from reverting | ||
* after 10 minutes. | ||
*/ | ||
confirmSetChannel(): Promise<number>; | ||
beginEditSettings(): Promise<number>; | ||
private beginEditSettings; | ||
commitEditSettings(): Promise<number>; | ||
/** | ||
* Confirms the currently set config, and prevents changes from reverting | ||
* after 10 minutes. | ||
*/ | ||
confirmSetConfig(): Promise<number>; | ||
/** | ||
* Resets the internal NodeDB of the radio, usefull for removing old nodes | ||
@@ -109,0 +101,0 @@ * that no longer exist. |
@@ -6,2 +6,3 @@ import { Logger } from "tslog"; | ||
import { Queue } from "./utils/queue.js"; | ||
import { XModem } from "./utils/xmodem.js"; | ||
/** Base class for connection methods to extend */ | ||
@@ -27,2 +28,3 @@ export class IMeshDevice { | ||
events; | ||
XModem; | ||
constructor(configId) { | ||
@@ -40,2 +42,3 @@ this.log = new Logger({ | ||
this.events = new EventSystem(); | ||
this.XModem = new XModem(this.sendRaw.bind(this)); //TODO: try wihtout bind | ||
this.events.onDeviceStatus.subscribe((status) => { | ||
@@ -134,2 +137,5 @@ this.deviceStatus = status; | ||
this.log.debug(Types.Emitter[Types.Emitter.setConfig], `Setting config`); | ||
if (!this.pendingSettingsChanges) { | ||
await this.beginEditSettings(); | ||
} | ||
const setRadio = new Protobuf.AdminMessage({ | ||
@@ -266,16 +272,2 @@ payloadVariant: { | ||
} | ||
/** | ||
* Confirms the currently set channels, and prevents changes from reverting | ||
* after 10 minutes. | ||
*/ | ||
async confirmSetChannel() { | ||
this.log.debug(Types.Emitter[Types.Emitter.confirmSetChannel], `📻 Confirming Channel config`); | ||
const confirmSetChannel = new Protobuf.AdminMessage({ | ||
payloadVariant: { | ||
case: "confirmSetRadio", | ||
value: true | ||
} | ||
}); | ||
return this.sendPacket(confirmSetChannel.toBinary(), Protobuf.PortNum.ADMIN_APP, "self"); | ||
} | ||
async beginEditSettings() { | ||
@@ -302,19 +294,2 @@ this.events.onPendingSettingsChange.emit(true); | ||
/** | ||
* Confirms the currently set config, and prevents changes from reverting | ||
* after 10 minutes. | ||
*/ | ||
async confirmSetConfig() { | ||
this.log.debug(Types.Emitter[Types.Emitter.confirmSetConfig], `Confirming config`); | ||
if (!this.pendingSettingsChanges) { | ||
await this.beginEditSettings(); | ||
} | ||
const confirmSetRadio = new Protobuf.AdminMessage({ | ||
payloadVariant: { | ||
case: "confirmSetRadio", | ||
value: true | ||
} | ||
}); | ||
return this.sendPacket(confirmSetRadio.toBinary(), Protobuf.PortNum.ADMIN_APP, "self"); | ||
} | ||
/** | ||
* Resets the internal NodeDB of the radio, usefull for removing old nodes | ||
@@ -505,2 +480,7 @@ * that no longer exist. | ||
break; | ||
case "queueStatus": | ||
break; | ||
case "xmodemPacket": | ||
void this.XModem.handlePacket(decodedMessage.payloadVariant.value); | ||
break; | ||
} | ||
@@ -507,0 +487,0 @@ } |
@@ -17,2 +17,3 @@ export * from "@buf/meshtastic_protobufs.bufbuild_es/meshtastic/admin_pb.js"; | ||
export * from "@buf/meshtastic_protobufs.bufbuild_es/meshtastic/telemetry_pb.js"; | ||
export * from "@buf/meshtastic_protobufs.bufbuild_es/meshtastic/xmodem_pb.js"; | ||
export * as native from "@bufbuild/protobuf"; |
@@ -17,3 +17,4 @@ export * from "@buf/meshtastic_protobufs.bufbuild_es/meshtastic/admin_pb.js"; | ||
export * from "@buf/meshtastic_protobufs.bufbuild_es/meshtastic/telemetry_pb.js"; | ||
export * from "@buf/meshtastic_protobufs.bufbuild_es/meshtastic/xmodem_pb.js"; | ||
export * as native from "@bufbuild/protobuf"; | ||
//# sourceMappingURL=protobufs.js.map |
{ | ||
"name": "@meshtastic/meshtasticjs", | ||
"version": "2.0.13-5", | ||
"version": "2.0.13-6", | ||
"description": "Browser library for interfacing with meshtastic devices", | ||
@@ -36,4 +36,5 @@ "license": "GPL-3.0-only", | ||
"dependencies": { | ||
"@buf/meshtastic_protobufs.bufbuild_es": "1.0.0-20230114035636-d95aa4c6a33c.1", | ||
"@buf/meshtastic_protobufs.bufbuild_es": "1.0.0-20230123093810-ef786e1f4e00.1", | ||
"@bufbuild/protobuf": "^1.0.0", | ||
"crc": "^4.3.1", | ||
"sub-events": "^1.9.0", | ||
@@ -46,4 +47,4 @@ "tslog": "^4.7.1" | ||
"@types/web-bluetooth": "^0.0.16", | ||
"@typescript-eslint/eslint-plugin": "^5.48.2", | ||
"@typescript-eslint/parser": "^5.48.2", | ||
"@typescript-eslint/eslint-plugin": "^5.49.0", | ||
"@typescript-eslint/parser": "^5.49.0", | ||
"eslint": "^8.32.0", | ||
@@ -50,0 +51,0 @@ "eslint-config-prettier": "^8.6.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
186496
46
2405
5
+ Addedcrc@^4.3.1
+ Addedcrc@4.3.2(transitive)
Updated@buf/meshtastic_protobufs.bufbuild_es@1.0.0-20230123093810-ef786e1f4e00.1