@meshbench/client 0.0.6 → 0.0.7

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/lib/device.mjs CHANGED
@@ -46,6 +46,14 @@ export class Device {
46
46
  * Held rather than clicked because the firmware cares: MeshCore wakes a
47
47
  * sleeping display on a press and powers the board off on a long one, so a
48
48
  * caller times the release itself - or uses `tap`, which does not hold. */
49
+ /** Restart the board, the way pressing its own reset button does.
50
+ *
51
+ * Torn down and built again from the same flash: whatever the firmware
52
+ * wrote survives and whatever it held in memory does not. */
53
+ async reset() {
54
+ await this._wb.call("board.reset", { node: this.name });
55
+ }
56
+
49
57
  async press(pin, down = true) {
50
58
  await this._wb.call("board.press", { node: this.name, pin, down });
51
59
  }
package/lib/workbench.mjs CHANGED
@@ -298,6 +298,22 @@ export class Workbench {
298
298
  return (got || {}).tab || "";
299
299
  }
300
300
 
301
+ /** Open a node's board view and return the board it is showing.
302
+ *
303
+ * The board in full: its panel, the controls for what it has wired, and what
304
+ * its profile declares beside what the firmware left in the chip. Windowed
305
+ * sessions only, for the same reason window() is, and refused for a node
306
+ * running a host build: there is no board to show. */
307
+ async boardView(node) {
308
+ if (this.isHeadless) {
309
+ throw new Unavailable("node.boardview",
310
+ "this session has no interface attached, so there is nothing to show",
311
+ "unavailable");
312
+ }
313
+ const got = await this.call("node.boardview", { node: String(node) });
314
+ return (got || {}).board || "";
315
+ }
316
+
301
317
  // ---- the shape -------------------------------------------------------
302
318
 
303
319
  get nodes() { return new Nodes(this); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meshbench/client",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "Drive a running MeshBench workbench from Node over its control socket.",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "type": "module",