@meshtastic/meshtasticjs
Advanced tools
Comparing version 0.6.29 to 0.6.30
@@ -18,2 +18,3 @@ /// <reference types="node" /> | ||
peningRequest: boolean; | ||
abortController: AbortController; | ||
constructor(); | ||
@@ -20,0 +21,0 @@ /** |
@@ -20,2 +20,3 @@ import { Types } from "./index.js"; | ||
peningRequest; | ||
abortController; | ||
constructor() { | ||
@@ -27,2 +28,3 @@ super(); | ||
this.peningRequest = false; | ||
this.abortController = new AbortController(); | ||
} | ||
@@ -63,2 +65,3 @@ /** | ||
disconnect() { | ||
this.abortController.abort(); | ||
if (this.readLoop) { | ||
@@ -75,4 +78,5 @@ clearInterval(this.readLoop); | ||
log(`IHTTPConnection.connect`, `Attempting device ping.`, LogRecord_Level.DEBUG); | ||
const { signal } = this.abortController; | ||
let pingSuccessful = false; | ||
await fetch(`${this.url}/hotspot-detect.html`, {}) | ||
await fetch(`${this.url}/hotspot-detect.html`, { signal }) | ||
.then(() => { | ||
@@ -97,5 +101,7 @@ pingSuccessful = true; | ||
let readBuffer = new ArrayBuffer(1); | ||
const { signal } = this.abortController; | ||
while (readBuffer.byteLength > 0) { | ||
this.peningRequest = true; | ||
await fetch(`${this.url}/api/v1/fromradio?all=${this.receiveBatchRequests ? "true" : "false"}`, { | ||
signal, | ||
method: "GET", | ||
@@ -125,3 +131,5 @@ headers: { | ||
async writeToRadio(data) { | ||
const { signal } = this.abortController; | ||
await fetch(`${this.url}/api/v1/toradio`, { | ||
signal, | ||
method: "PUT", | ||
@@ -128,0 +136,0 @@ headers: { |
{ | ||
"name": "@meshtastic/meshtasticjs", | ||
"version": "0.6.29", | ||
"version": "0.6.30", | ||
"description": "Browser library for interfacing with meshtastic devices", | ||
@@ -39,3 +39,3 @@ "license": "GPL-3.0-only", | ||
"babel-plugin-module-resolver": "^4.1.0", | ||
"eslint": "^8.2.0", | ||
"eslint": "^8.3.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
@@ -42,0 +42,0 @@ "eslint-import-resolver-babel-module": "^5.3.1", |
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
366153
7041