@emdzej/j2534-webserial 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +40 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +158 -0
- package/dist/index.js.map +1 -0
- package/package.json +57 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Michał Jaskólski
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# @emdzej/j2534-webserial
|
|
2
|
+
|
|
3
|
+
Browser **Web Serial** transport for
|
|
4
|
+
[`@emdzej/j2534-driver`](https://www.npmjs.com/package/@emdzej/j2534-driver).
|
|
5
|
+
Talks to the Tactrix OpenPort 2.0 directly from Chrome / Edge — no
|
|
6
|
+
native dependencies. Works in any modern Chromium-based browser
|
|
7
|
+
that exposes [`navigator.serial`](https://developer.mozilla.org/en-US/docs/Web/API/Web_Serial_API).
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @emdzej/j2534-driver @emdzej/j2534-webserial
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Use
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { J2534Device } from '@emdzej/j2534-driver';
|
|
19
|
+
import { createWebSerialTransport } from '@emdzej/j2534-webserial';
|
|
20
|
+
|
|
21
|
+
// must be called from a user-gesture handler (button click etc.)
|
|
22
|
+
const transport = await createWebSerialTransport();
|
|
23
|
+
|
|
24
|
+
const dev = new J2534Device(transport);
|
|
25
|
+
await dev.open();
|
|
26
|
+
// … see @emdzej/j2534-driver
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The browser shows its standard port-picker dialog; the user grants
|
|
30
|
+
access per-origin / per-device.
|
|
31
|
+
|
|
32
|
+
## See also
|
|
33
|
+
|
|
34
|
+
- [Root README](https://github.com/emdzej/j2534#readme)
|
|
35
|
+
- [`@emdzej/j2534-webusb`](https://www.npmjs.com/package/@emdzej/j2534-webusb) —
|
|
36
|
+
WebUSB alternative when Web Serial isn't available
|
|
37
|
+
|
|
38
|
+
## License
|
|
39
|
+
|
|
40
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type Transport, type DeviceInfo } from "@emdzej/j2534-types";
|
|
2
|
+
/**
|
|
3
|
+
* Browser Web Serial transport for J2534 devices.
|
|
4
|
+
*
|
|
5
|
+
* The Tactrix OpenPort 2.0 presents as a CDC ACM device (virtual COM port),
|
|
6
|
+
* which Chrome's WebUSB blocks but Web Serial handles natively.
|
|
7
|
+
*/
|
|
8
|
+
export declare class WebSerialTransport implements Transport {
|
|
9
|
+
private vendorId;
|
|
10
|
+
private productId;
|
|
11
|
+
private port;
|
|
12
|
+
private reader;
|
|
13
|
+
private writer;
|
|
14
|
+
private _isConnected;
|
|
15
|
+
private rxBuffer;
|
|
16
|
+
constructor(vendorId?: number, productId?: number);
|
|
17
|
+
get isConnected(): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Request a serial port and open it. Must be called from a user gesture.
|
|
20
|
+
*
|
|
21
|
+
* The OpenPort 2.0 CDC device doesn't use standard baud rate negotiation —
|
|
22
|
+
* the baud rate parameter is ignored by the firmware. We set a high value
|
|
23
|
+
* to avoid any artificial throttling by the OS serial driver.
|
|
24
|
+
*/
|
|
25
|
+
open(): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Background read loop that accumulates incoming data.
|
|
28
|
+
* The J2534 device sends asynchronous responses (ack, messages, etc.)
|
|
29
|
+
* that we need to buffer for the driver's polling read calls.
|
|
30
|
+
*/
|
|
31
|
+
private readLoop;
|
|
32
|
+
close(): Promise<void>;
|
|
33
|
+
write(data: Uint8Array): Promise<number>;
|
|
34
|
+
read(timeout?: number): Promise<Uint8Array>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* List already-granted serial ports matching the OpenPort VID/PID.
|
|
38
|
+
* No user gesture required.
|
|
39
|
+
*/
|
|
40
|
+
export declare function listDevices(vid?: number, pid?: number): Promise<DeviceInfo[]>;
|
|
41
|
+
export default WebSerialTransport;
|
|
42
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,UAAU,EAGhB,MAAM,qBAAqB,CAAC;AAE7B;;;;;GAKG;AACH,qBAAa,kBAAmB,YAAW,SAAS;IAQhD,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,SAAS;IARnB,OAAO,CAAC,IAAI,CAA2B;IACvC,OAAO,CAAC,MAAM,CAAwD;IACtE,OAAO,CAAC,MAAM,CAAwD;IACtE,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAoB;gBAG1B,QAAQ,SAAe,EACvB,SAAS,SAAe;IAGlC,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED;;;;;;OAMG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAyC3B;;;;OAIG;YACW,QAAQ;IAehB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAiBtB,KAAK,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAQxC,IAAI,CAAC,OAAO,SAAO,GAAG,OAAO,CAAC,UAAU,CAAC;CA2BhD;AAED;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,GAAG,SAAe,EAClB,GAAG,SAAe,GACjB,OAAO,CAAC,UAAU,EAAE,CAAC,CAevB;AAED,eAAe,kBAAkB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { OPENPORT_VID, OPENPORT_PID, } from "@emdzej/j2534-types";
|
|
2
|
+
/**
|
|
3
|
+
* Browser Web Serial transport for J2534 devices.
|
|
4
|
+
*
|
|
5
|
+
* The Tactrix OpenPort 2.0 presents as a CDC ACM device (virtual COM port),
|
|
6
|
+
* which Chrome's WebUSB blocks but Web Serial handles natively.
|
|
7
|
+
*/
|
|
8
|
+
export class WebSerialTransport {
|
|
9
|
+
vendorId;
|
|
10
|
+
productId;
|
|
11
|
+
port = null;
|
|
12
|
+
reader = null;
|
|
13
|
+
writer = null;
|
|
14
|
+
_isConnected = false;
|
|
15
|
+
rxBuffer = [];
|
|
16
|
+
constructor(vendorId = OPENPORT_VID, productId = OPENPORT_PID) {
|
|
17
|
+
this.vendorId = vendorId;
|
|
18
|
+
this.productId = productId;
|
|
19
|
+
}
|
|
20
|
+
get isConnected() {
|
|
21
|
+
return this._isConnected;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Request a serial port and open it. Must be called from a user gesture.
|
|
25
|
+
*
|
|
26
|
+
* The OpenPort 2.0 CDC device doesn't use standard baud rate negotiation —
|
|
27
|
+
* the baud rate parameter is ignored by the firmware. We set a high value
|
|
28
|
+
* to avoid any artificial throttling by the OS serial driver.
|
|
29
|
+
*/
|
|
30
|
+
async open() {
|
|
31
|
+
if (!("serial" in navigator)) {
|
|
32
|
+
throw new Error("Web Serial API is not supported in this browser");
|
|
33
|
+
}
|
|
34
|
+
// Try to find an already-granted port first
|
|
35
|
+
const ports = await navigator.serial.getPorts();
|
|
36
|
+
this.port =
|
|
37
|
+
ports.find((p) => {
|
|
38
|
+
const info = p.getInfo();
|
|
39
|
+
return (info.usbVendorId === this.vendorId &&
|
|
40
|
+
info.usbProductId === this.productId);
|
|
41
|
+
}) ?? null;
|
|
42
|
+
// If not found, prompt user
|
|
43
|
+
if (!this.port) {
|
|
44
|
+
this.port = await navigator.serial.requestPort({
|
|
45
|
+
filters: [{ usbVendorId: this.vendorId, usbProductId: this.productId }],
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
await this.port.open({
|
|
49
|
+
baudRate: 500000, // ignored by OpenPort firmware, but required by API
|
|
50
|
+
bufferSize: 4096,
|
|
51
|
+
});
|
|
52
|
+
if (this.port.readable && this.port.writable) {
|
|
53
|
+
this.reader = this.port.readable.getReader();
|
|
54
|
+
this.writer = this.port.writable.getWriter();
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
throw new Error("Failed to obtain readable/writable streams from serial port");
|
|
58
|
+
}
|
|
59
|
+
this._isConnected = true;
|
|
60
|
+
// Start background reading into buffer
|
|
61
|
+
this.readLoop();
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Background read loop that accumulates incoming data.
|
|
65
|
+
* The J2534 device sends asynchronous responses (ack, messages, etc.)
|
|
66
|
+
* that we need to buffer for the driver's polling read calls.
|
|
67
|
+
*/
|
|
68
|
+
async readLoop() {
|
|
69
|
+
if (!this.reader)
|
|
70
|
+
return;
|
|
71
|
+
try {
|
|
72
|
+
while (this._isConnected) {
|
|
73
|
+
const { value, done } = await this.reader.read();
|
|
74
|
+
if (done)
|
|
75
|
+
break;
|
|
76
|
+
if (value && value.length > 0) {
|
|
77
|
+
this.rxBuffer.push(value);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
// Port closed or error — expected during disconnect
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async close() {
|
|
86
|
+
this._isConnected = false;
|
|
87
|
+
try {
|
|
88
|
+
this.reader?.releaseLock();
|
|
89
|
+
}
|
|
90
|
+
catch { }
|
|
91
|
+
try {
|
|
92
|
+
this.writer?.releaseLock();
|
|
93
|
+
}
|
|
94
|
+
catch { }
|
|
95
|
+
this.reader = null;
|
|
96
|
+
this.writer = null;
|
|
97
|
+
try {
|
|
98
|
+
await this.port?.close();
|
|
99
|
+
}
|
|
100
|
+
catch { }
|
|
101
|
+
this.port = null;
|
|
102
|
+
this.rxBuffer = [];
|
|
103
|
+
}
|
|
104
|
+
async write(data) {
|
|
105
|
+
if (!this.writer) {
|
|
106
|
+
throw new Error("Transport not connected");
|
|
107
|
+
}
|
|
108
|
+
await this.writer.write(data);
|
|
109
|
+
return data.length;
|
|
110
|
+
}
|
|
111
|
+
async read(timeout = 1000) {
|
|
112
|
+
const deadline = Date.now() + timeout;
|
|
113
|
+
// Wait for data to appear in the rx buffer
|
|
114
|
+
while (this.rxBuffer.length === 0) {
|
|
115
|
+
if (Date.now() >= deadline) {
|
|
116
|
+
throw new Error("Read timeout");
|
|
117
|
+
}
|
|
118
|
+
await new Promise((r) => setTimeout(r, 5));
|
|
119
|
+
}
|
|
120
|
+
// Drain all buffered chunks into a single response
|
|
121
|
+
// (matches the bulk transfer behavior of USB transport)
|
|
122
|
+
if (this.rxBuffer.length === 1) {
|
|
123
|
+
return this.rxBuffer.shift();
|
|
124
|
+
}
|
|
125
|
+
const total = this.rxBuffer.reduce((sum, chunk) => sum + chunk.length, 0);
|
|
126
|
+
const result = new Uint8Array(total);
|
|
127
|
+
let offset = 0;
|
|
128
|
+
for (const chunk of this.rxBuffer) {
|
|
129
|
+
result.set(chunk, offset);
|
|
130
|
+
offset += chunk.length;
|
|
131
|
+
}
|
|
132
|
+
this.rxBuffer = [];
|
|
133
|
+
return result;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* List already-granted serial ports matching the OpenPort VID/PID.
|
|
138
|
+
* No user gesture required.
|
|
139
|
+
*/
|
|
140
|
+
export async function listDevices(vid = OPENPORT_VID, pid = OPENPORT_PID) {
|
|
141
|
+
if (!("serial" in navigator))
|
|
142
|
+
return [];
|
|
143
|
+
const ports = await navigator.serial.getPorts();
|
|
144
|
+
return ports
|
|
145
|
+
.filter((p) => {
|
|
146
|
+
const info = p.getInfo();
|
|
147
|
+
return info.usbVendorId === vid && info.usbProductId === pid;
|
|
148
|
+
})
|
|
149
|
+
.map((p) => {
|
|
150
|
+
const info = p.getInfo();
|
|
151
|
+
return {
|
|
152
|
+
vendorId: info.usbVendorId,
|
|
153
|
+
productId: info.usbProductId,
|
|
154
|
+
};
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
export default WebSerialTransport;
|
|
158
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,YAAY,EACZ,YAAY,GACb,MAAM,qBAAqB,CAAC;AAE7B;;;;;GAKG;AACH,MAAM,OAAO,kBAAkB;IAQnB;IACA;IARF,IAAI,GAAsB,IAAI,CAAC;IAC/B,MAAM,GAAmD,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|
+
"name": "@emdzej/j2534-webserial",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Browser Web Serial API transport for @emdzej/j2534-driver. Talks to the Tactrix OpenPort 2.0 directly from Chrome/Edge — no native dependencies, runs in any modern Chromium-based browser.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"j2534",
|
|
7
|
+
"passthru",
|
|
8
|
+
"tactrix",
|
|
9
|
+
"openport",
|
|
10
|
+
"diagnostics",
|
|
11
|
+
"web-serial",
|
|
12
|
+
"browser",
|
|
13
|
+
"transport",
|
|
14
|
+
"typescript"
|
|
15
|
+
],
|
|
16
|
+
"homepage": "https://github.com/emdzej/j2534#readme",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/emdzej/j2534.git",
|
|
20
|
+
"directory": "packages/webserial"
|
|
21
|
+
},
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/emdzej/j2534/issues"
|
|
24
|
+
},
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"author": "Michał Jaskólski",
|
|
27
|
+
"type": "module",
|
|
28
|
+
"main": "./dist/index.js",
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"import": "./dist/index.js"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"dist",
|
|
38
|
+
"README.md",
|
|
39
|
+
"LICENSE"
|
|
40
|
+
],
|
|
41
|
+
"sideEffects": false,
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@emdzej/j2534-types": "0.1.0"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/w3c-web-serial": "^1.0.7",
|
|
50
|
+
"typescript": "^5.7.0"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "tsc",
|
|
54
|
+
"dev": "tsc --watch",
|
|
55
|
+
"clean": "rm -rf dist"
|
|
56
|
+
}
|
|
57
|
+
}
|