Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@meshtastic/meshtasticjs

Package Overview
Dependencies
Maintainers
1
Versions
181
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@meshtastic/meshtasticjs - npm Package Compare versions

Comparing version 0.6.81 to 0.6.82

dist/iNodeSerialConnection.d.ts

2

dist/constants.d.ts

@@ -25,2 +25,2 @@ /**

*/
export declare const MIN_FW_VERSION = 1.2;
export declare const MIN_FW_VERSION = 1.3;

@@ -25,3 +25,3 @@ /**

*/
export const MIN_FW_VERSION = 1.2;
export const MIN_FW_VERSION = 1.3;
//# sourceMappingURL=constants.js.map
import { Types } from "./index.js";
import { IMeshDevice } from "./iMeshDevice.js";
import { LogRecord_Level } from "./generated/mesh.js";
import { transformHandler } from "./utils/transformHandler.js";
/**

@@ -74,4 +75,4 @@ * Allows to connect to a Meshtastic device over WebSerial

this.port = parameters.port ? parameters.port : await this.getPort();
this.port.addEventListener("disconnect", (e) => {
this.log(Types.EmitterScope.iSerialConnection, Types.Emitter.connect, `Device disconnected: ${e}`, LogRecord_Level.INFO);
this.port.addEventListener("disconnect", () => {
this.log(Types.EmitterScope.iSerialConnection, Types.Emitter.connect, "Device disconnected", LogRecord_Level.INFO);
this.updateDeviceStatus(Types.DeviceStatusEnum.DEVICE_DISCONNECTED);

@@ -84,18 +85,8 @@ this.complete();

});
let byteBuffer = new Uint8Array([]);
if (this.port.readable && this.port.writable) {
const transformer = new TransformStream({
transform(chunk, controller) {
byteBuffer = new Uint8Array([...byteBuffer, ...chunk]);
if (byteBuffer.includes(0x94)) {
const index = byteBuffer.findIndex((byte) => byte === 0x94);
const startBit2 = byteBuffer[index + 1];
const msb = byteBuffer[index + 2] ?? 0;
const lsb = byteBuffer[index + 3] ?? 0;
const len = index + 4 + lsb + msb;
if (startBit2 === 0xc3 && byteBuffer.length >= len) {
controller.enqueue(byteBuffer.subarray(index + 4, len));
byteBuffer = byteBuffer.slice(len);
}
}
transformHandler(new Uint8Array([]), chunk, (buffer) => {
controller.enqueue(buffer);
});
}

@@ -102,0 +93,0 @@ });

@@ -125,5 +125,6 @@ /// <reference types="web-bluetooth" />

"iSerialConnection" = 1,
"iBleConnection" = 2,
"iHttpConnection" = 3,
"SettingsManager" = 4
"iNodeSerialConnection" = 2,
"iBleConnection" = 3,
"iHttpConnection" = 4,
"SettingsManager" = 5
}

@@ -130,0 +131,0 @@ export declare enum Emitter {

@@ -15,5 +15,6 @@ export var DeviceStatusEnum;

EmitterScope[EmitterScope["iSerialConnection"] = 1] = "iSerialConnection";
EmitterScope[EmitterScope["iBleConnection"] = 2] = "iBleConnection";
EmitterScope[EmitterScope["iHttpConnection"] = 3] = "iHttpConnection";
EmitterScope[EmitterScope["SettingsManager"] = 4] = "SettingsManager";
EmitterScope[EmitterScope["iNodeSerialConnection"] = 2] = "iNodeSerialConnection";
EmitterScope[EmitterScope["iBleConnection"] = 3] = "iBleConnection";
EmitterScope[EmitterScope["iHttpConnection"] = 4] = "iHttpConnection";
EmitterScope[EmitterScope["SettingsManager"] = 5] = "SettingsManager";
})(EmitterScope || (EmitterScope = {}));

@@ -20,0 +21,0 @@ export var Emitter;

{
"name": "@meshtastic/meshtasticjs",
"version": "0.6.81",
"version": "0.6.82",
"description": "Browser library for interfacing with meshtastic devices",

@@ -13,2 +13,6 @@ "license": "GPL-3.0-only",

"types": "./types/index.d.ts"
},
"./node": {
"import": "./dist/node/index.js",
"types": "./types/node/index.d.ts"
}

@@ -30,3 +34,5 @@ },

"@protobuf-ts/runtime": "^2.7.0",
"@serialport/stream": "^10.3.0",
"prettier": "^2.7.1",
"serialport": "^10.4.0",
"sub-events": "^1.8.9"

@@ -37,5 +43,5 @@ },

"@types/w3c-web-serial": "^1.0.2",
"@types/web-bluetooth": "^0.0.14",
"@types/web-bluetooth": "^0.0.15",
"node-protoc": "^1.0.3",
"typedoc": "^0.23.8",
"typedoc": "^0.23.9",
"typescript": "^4.7.4"

@@ -42,0 +48,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc