@elkamarado/remote-oscilloscope-tbs2204b-driver 0.1.0 → 0.2.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/README.md +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +14 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,6 +25,10 @@ seconds-per-division. `getDisplaySettings()` reads the same settings without
|
|
|
25
25
|
capturing. `decodeI2c()` operates on the captured waveforms and does not
|
|
26
26
|
require further instrument commands.
|
|
27
27
|
|
|
28
|
+
`executeScpi(command)` sends a single-line text SCPI command and returns its
|
|
29
|
+
response for queries. Binary waveform queries are intentionally excluded;
|
|
30
|
+
use `capture()` for waveform data.
|
|
31
|
+
|
|
28
32
|
The initial implementation uses the scope's current waveform transfer window.
|
|
29
33
|
It does not change vertical or horizontal display settings.
|
|
30
34
|
|
package/dist/index.d.ts
CHANGED
|
@@ -63,6 +63,7 @@ declare class Tbs2204bDriver {
|
|
|
63
63
|
get connected(): boolean;
|
|
64
64
|
connect(): Promise<void>;
|
|
65
65
|
disconnect(): Promise<void>;
|
|
66
|
+
executeScpi(command: string): Promise<string>;
|
|
66
67
|
identify(): Promise<DeviceIdentity>;
|
|
67
68
|
getDisplaySettings(): Promise<ScopeDisplaySettings>;
|
|
68
69
|
capture(channels: readonly Channel[]): Promise<Waveform[]>;
|
package/dist/index.js
CHANGED
|
@@ -244,6 +244,20 @@ var Tbs2204bDriver = class {
|
|
|
244
244
|
disconnect() {
|
|
245
245
|
return this.enqueue(() => this.connection.disconnect());
|
|
246
246
|
}
|
|
247
|
+
executeScpi(command) {
|
|
248
|
+
return this.enqueue(async () => {
|
|
249
|
+
if (!command.trim() || /[\r\n]/.test(command)) {
|
|
250
|
+
throw new Error("SCPI command must be a non-empty single line");
|
|
251
|
+
}
|
|
252
|
+
const normalized = command.trim();
|
|
253
|
+
if (/CURVe\s*\?$/i.test(normalized)) {
|
|
254
|
+
throw new Error("Binary waveform queries are handled by waveform capture, not the text terminal");
|
|
255
|
+
}
|
|
256
|
+
if (normalized.endsWith("?")) return this.connection.queryLine(normalized);
|
|
257
|
+
await this.connection.write(normalized);
|
|
258
|
+
return "Sent; no response was requested.";
|
|
259
|
+
});
|
|
260
|
+
}
|
|
247
261
|
identify() {
|
|
248
262
|
return this.enqueue(async () => {
|
|
249
263
|
const raw = await this.connection.queryLine("*IDN?");
|
package/package.json
CHANGED