Uc2 Esp
@vcjdeboer/uc2-espv2026.09.12.4
01README
Drive a UC2-ESP device from swamp over USB serial and record every exchange as versioned data. One model type, uc2-device, speaks the UC2-ESP task protocol ({task, qid, ...} with ACK, async events and a final DONE correlated by request id) from Diederich et al., J. Microscopy 2026 (doi:10.1111/jmi.70147).
02Models
@vcjdeboer/uc2-devicev2026.09.12.1uc2_device.ts
Global Arguments
| Argument | Type | Description |
|---|---|---|
| device? | string | Serial device path: /dev/cu.usbmodemXXXX on macOS, /dev/ttyACM0 on Linux. |
| baud | number | |
| timeoutMs | number | Hard cap on waiting for a request's final reply. |
| idleMs | number | Silence that ends a read burst once bytes have arrived. |
| settleMs | number | Discard this many ms of stale bytes after opening the port. |
| holder | boolean | Keep the port open between calls in a detached worker (start with `hold`). |
| holderIdleTimeoutMs | number | |
| denoPath? | string |
fn detect()
List serial device nodes on this host without opening any, and record
fn act(task: string, args: record, timeoutMs?: number)
Run a UC2 ACT endpoint: send {task, qid, ...args}, correlate the board's
| Argument | Type | Description |
|---|---|---|
| task | string | The ACT endpoint, e.g. /motor_act |
| args | record | Parameters merged into the request object |
| timeoutMs? | number |
fn get(task: string, timeoutMs?: number)
Read a UC2 GET endpoint: send {task, qid} and record the state the board
| Argument | Type | Description |
|---|---|---|
| task | string | The GET endpoint, e.g. /motor_get |
| timeoutMs? | number |
fn listen(timeoutMs?: number)
Listen for unsolicited event lines (JSON with an "event" field and
| Argument | Type | Description |
|---|---|---|
| timeoutMs? | number | How long to listen; defaults to the global timeoutMs |
fn hold()
Start a detached worker that keeps the port open between calls
fn release()
Stop the holder: close the port and let the detached worker exit.
03Previous Versions
2026.09.12.3
2026.09.12.2
2026.09.12.1
04Stats
B
85 / 100
Downloads
0
Archive size
33.8 KB
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License declared1/1earned
- Verified public repository0/2missing
Repository
https://github.com/vcjdeboer/uc2-esp05Platforms