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.108 to 0.6.109

1

dist/iBleConnection.d.ts

@@ -10,2 +10,3 @@ /// <reference types="web-bluetooth" />

device: BluetoothDevice | undefined;
GATTServer: BluetoothRemoteGATTServer | undefined;
/** Short Description */

@@ -12,0 +13,0 @@ service: BluetoothRemoteGATTService | undefined;

@@ -11,2 +11,3 @@ import { Protobuf, Types } from "./index.js";

device;
GATTServer;
/** Short Description */

@@ -27,2 +28,3 @@ service;

this.service = undefined;
this.GATTServer = undefined;
this.toRadioCharacteristic = undefined;

@@ -86,8 +88,41 @@ this.fromRadioCharacteristic = undefined;

/** Connect to device */
await this.device.gatt?.connect();
this.service = await this.device.gatt?.getPrimaryService(serviceUUID);
this.toRadioCharacteristic = await this.service?.getCharacteristic(toRadioUUID);
this.fromRadioCharacteristic = await this.service?.getCharacteristic(fromRadioUUID);
this.fromNumCharacteristic = await this.service?.getCharacteristic(fromNumUUID);
await this.fromNumCharacteristic?.startNotifications();
await this.device.gatt
?.connect()
.then((server) => {
this.log(Types.EmitterScope.iBleConnection, Types.Emitter.connect, `✅ Got GATT Server for device: ${server.device.id}`, Protobuf.LogRecord_Level.INFO);
this.GATTServer = server;
})
.catch((e) => {
this.log(Types.EmitterScope.iBleConnection, Types.Emitter.connect, `❌ Failed to connect: ${e.message}`, Protobuf.LogRecord_Level.ERROR);
});
await this.GATTServer?.getPrimaryService(serviceUUID)
.then((service) => {
this.log(Types.EmitterScope.iBleConnection, Types.Emitter.connect, `✅ Got GATT Service for device: ${service.device.id}`, Protobuf.LogRecord_Level.INFO);
this.service = service;
})
.catch((e) => {
this.log(Types.EmitterScope.iBleConnection, Types.Emitter.connect, `❌ Failed to get primary service: q${e.message}`, Protobuf.LogRecord_Level.ERROR);
});
[toRadioUUID, fromRadioUUID, fromNumUUID].map(async (uuid) => {
await this.service
?.getCharacteristic(uuid)
.then((characteristic) => {
this.log(Types.EmitterScope.iBleConnection, Types.Emitter.connect, `✅ Got Characteristic ${characteristic.uuid} for device: ${characteristic.name}`, Protobuf.LogRecord_Level.INFO);
switch (uuid) {
case toRadioUUID:
this.toRadioCharacteristic = characteristic;
break;
case fromRadioUUID:
this.fromRadioCharacteristic = characteristic;
break;
case fromNumUUID:
this.fromNumCharacteristic = characteristic;
break;
}
})
.catch((e) => {
this.log(Types.EmitterScope.iBleConnection, Types.Emitter.connect, `❌ Failed to get toRadio characteristic: q${e.message}`, Protobuf.LogRecord_Level.ERROR);
});
});
await this.fromNumCharacteristic?.startNotifications(); // TODO: catch
this.fromNumCharacteristic?.addEventListener("characteristicvaluechanged", () => {

@@ -94,0 +129,0 @@ void this.readFromRadio();

2

package.json
{
"name": "@meshtastic/meshtasticjs",
"version": "0.6.108",
"version": "0.6.109",
"description": "Browser library for interfacing with meshtastic devices",

@@ -5,0 +5,0 @@ "license": "GPL-3.0-only",

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