component
GenericInspector
Default inspector view used for any peripheral that has no domain-specific view registered in `PERIPHERAL_VIEWS`. Renders the raw snapshot field map, pretty-printing any JSON-string fields. This is what makes "implement the inspector, see it in the UI" work before a custom view exists. Accepts the uniform PeripheralViewProps shape, so it can stand in for any registered view.
function GenericInspector(props: PeripheralViewProps): JSX.ElementProps
| Name | Type | Description |
|---|---|---|
name | string | Peripheral name as reported by the machine (e.g. "kmu", "uicr"). |
events | PeripheralEvent[] | All peripheral events seen so far; the view filters for the ones it cares about. |
refreshKey | number | Monotonic counter that increments whenever new events arrive. |
getSnapshot | () => PeripheralSnapshot | null | Pull the current snapshot for this peripheral (null if unavailable). |
sendCommand | (cmd: { name: string; params: Record<string, string> }) => void | Send a command to this peripheral's inspector. |
Examples
<GenericInspector
name="uicr"
events={peripheralEvents}
refreshKey={snapshotVersion}
getSnapshot={() => getPeripheralSnapshot("uicr")}
sendCommand={(cmd) => sendPeripheralCommand("uicr", cmd)}
/>