USB Implementation
Interface
Treuzell comes as a single USB interface, with 3 endpoints:
InterfaceClass: 255 (Vendor Specific)
InterfaceSubClass: Vendor dependent, usually 19
InterfaceProtocol: 0
First Endpoint: Ctrl IN
type: bulk
direction: IN
Second Endpoint: Ctrl OUT
type: bulk
direction: OUT
Third Endpoint: Data IN
type: bulk
direction: IN
The choice of endpoint type could be discussed:
Endpoints for camera control are bulk, as no real-time property is expected on commands.
The data transfer is also bulk. Note that isochronous could have make sense, but the poor performances of some implementations made bulk being chosen, prioritizing effective bandwidth over bandwidth and latency guarantee. Also, guarantee of delivery is more important than latency in multiple situation.
Finally, bulk endpoints allow large transactions, for instance to load a firmware, but interrupt transfers may allow guaranteed latency, which may be useful for some commands.
Control protocol
The camera is controlled as a slave with the ctrl OUT and ctrl IN endpoints.
Transactions are always initiated by the host, and always answered by the device upon completion.
The host shall read the device answers.
The device may wait until an answer is read before accepting further commands.
Control commands shall always begin at the start on a bulk packet and therefore can’t be concatenated in a single packet.
Multi-byte fields in the protocol are always little-endian, regardless of host and device endianness.