ousspero / Software engineering

Make device integrations easier to diagnose

Engineering guide · Updated 7 November 2026

A device integration has at least two views of reality: what the application asked for and what the device actually did. A user clicking a button proves only that the application received an instruction. It does not prove that a camera captured a frame or a display updated its score.

Define what success means

Separate command submission, receipt, and completion. For a camera workflow, these could mean that a capture request was queued, that the camera accepted it, and that the resulting file is available. Show those stages when the distinction matters to the operator.

When the protocol allows it, attach a command identifier to requests and responses. Record the timestamp and device identity. An acknowledgement for an earlier request should not accidentally mark a newer operation as complete.

Choose a recovery policy for each command

Some operations are safe to repeat, such as setting a display to a particular score. Others are not, such as triggering another capture or dispensing an item. Classify commands before applying automatic retries. A missing acknowledgement may mean the command was lost, or it may mean the response was lost after execution.

When outcome is uncertain, query device state if the protocol supports it. Otherwise show the uncertainty and provide a deliberate recovery action. Blindly resending every command can turn a communication fault into a duplicated physical operation.

Keep the interface responsive

Device communication should not block the interface thread. Bound queues so that a disconnected device cannot accumulate unlimited pending work. Consider whether old requests still make sense after reconnection. A scoreboard generally needs the latest complete score, not a replay of every obsolete intermediate update.

Test faults as part of the workflow

Disconnect the device, restart the application, introduce a delayed response, and deliver a duplicate message. Check what the operator sees and whether recovery produces a consistent final state. In a safe test environment, verify what happens when the device restarts during an active command.

Software that controls physical equipment also needs device-specific safety measures. The communication checklist does not replace hardware interlocks, emergency stops, or the manufacturer's operating requirements.