Feature: USB Instrument Enumeration API (Global / chartread) #6

Closed
opened 2026-08-21 09:12:06 +01:00 by gronod · 1 comment
Owner

Description

Add a flag (e.g., chartread -u -c list or a standalone utility) to query connected USB instruments and return a JSON array of device ports and names.

Rationale

Allows a host UI to automatically populate a "Select Instrument" hardware dropdown dynamically without relying on OS-level USB polling or brittle string parsing of chartread -?.

Proposed Output

{
  "event": "instruments",
  "devices": [
    {"port": 1, "name": "i1Pro 2", "type": "i1"}
  ]
}
### Description Add a flag (e.g., `chartread -u -c list` or a standalone utility) to query connected USB instruments and return a JSON array of device ports and names. ### Rationale Allows a host UI to automatically populate a "Select Instrument" hardware dropdown dynamically without relying on OS-level USB polling or brittle string parsing of `chartread -?`. ### Proposed Output ```json { "event": "instruments", "devices": [ {"port": 1, "name": "i1Pro 2", "type": "i1"} ] } ```
gronod added this to the v3.5.1 - UI Subprocess Integration milestone 2026-08-21 09:12:06 +01:00
gronod added the Kind/Feature
Reviewed
Confirmed
1
Area/UI
labels 2026-08-21 18:31:46 +01:00
Author
Owner

Implementation Completed

The standalone instrument enumeration tool instlist has been implemented and pushed to branch feature/usb-enumeration in commit b2435a8.

Summary of Deliverables:

  1. spectro/instlist.c:
    • Uses cross-platform new_icompaths() to discover USB and serial spectrophotometers and colorimeters across Linux, macOS, and Windows.
    • Emits structured JSON array containing port, name, and type.
    • Supports standard -h, -?, --help, -v, and -D [level] switches.
  2. spectro/Jamfile:
    • Added instlist to Executables and defined its Main compilation rule.
  3. Documentation:
    • Created doc/instlist.html with usage guide, switches, and schema.
    • Registered spectro/instlist.exe in doc/MinorTools.html.

JSON Output Format:

{
  "event": "instruments",
  "devices": [
    {
      "port": 1,
      "name": "usb:/bus0/dev1 (X-Rite i1Pro)",
      "type": "i1Pro"
    }
  ]
}
### Implementation Completed The standalone instrument enumeration tool `instlist` has been implemented and pushed to branch `feature/usb-enumeration` in commit `b2435a8`. #### Summary of Deliverables: 1. **`spectro/instlist.c`**: - Uses cross-platform `new_icompaths()` to discover USB and serial spectrophotometers and colorimeters across Linux, macOS, and Windows. - Emits structured JSON array containing `port`, `name`, and `type`. - Supports standard `-h`, `-?`, `--help`, `-v`, and `-D [level]` switches. 2. **`spectro/Jamfile`**: - Added `instlist` to `Executables` and defined its `Main` compilation rule. 3. **Documentation**: - Created `doc/instlist.html` with usage guide, switches, and schema. - Registered `spectro/instlist.exe` in `doc/MinorTools.html`. #### JSON Output Format: ```json { "event": "instruments", "devices": [ { "port": 1, "name": "usb:/bus0/dev1 (X-Rite i1Pro)", "type": "i1Pro" } ] } ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gronod/argyllcms#6