Zedmon USB Protocol

Device and Vendor ID

Zedmon devices all share the same device and vendor ID:

Vendor ID 0x18d1 (Google, Inc.)

Device ID: 0xaf00

Interfaces and Endpoints

Zedmon exposes two USB interfaces. One is a CDC Serial interface that can be used to communicate with the lk console. The other is a pair of bulk endpoints which speak the protocol documented here. This interface is specified as:

Class: 0xff Subclass: 0xff Protocol: 0x00

Future versions may use other protocol numbers.

Packet Structure

Zedmon packets are encapsulated in USB packets. The only common header is a 1 byte packet type field. Packet length and error detection is handled by USB. Some packets only contain the 1 byte packet type header and no payload. If a single report does not fit in a USB packet, the behavior is undefined.

Packet Types

The valid packet types are:

IDDirDescription
0x00H->TQuery Report Format
0x01H->TQuery Time
0x10H->TEnable Reporting
0x11H->TDisable Reporting
0x20H->TSet Output
0x80T->HReport Format
0x81T->HReport
0x82H->TTimestamp

Packet Field and Value Types

The following data types are using in packets. Types with n/a IDs are not valid types for report data.

IDTypeDescription
0x00uint8Unsigned 8 Bit Integer
0x01uint16Unsigned 16 Bit Little-Endian Integer
0x03uint32Unsigned 32 Bit Little-Endian Integer
0x04uint64Unsigned 64 Bit Little-Endian Integer
0x10int8Signed 8 Bit Integer
0x11int16Signed 16 Bit Little-Endian Integer
0x13int32Signed 32 Bit Little-Endian Integer
0x14int64Signed 64 Bit Little-Endian Integer
0x20boolBoolean Represented as a uint8 (non-zero == true).
0x40float3232 Bit Little-Endian IEEE-745 Floating Point
n/astringNull-Terminated ASCII Encoded String.

Units

The following units are used in report format packets:

IDDescription
0x00Amperes
0x01Volts

Packets

0x00 - Query Report Format

Requests the target send a Report Format packet. If the target responds with a Report Format packet with the Value Index of 0xff, this indicates that there is no value at that index. To enumerate the values, the host should start by requesting Value Index 0 and continue to request the next Value Index until receiving a packet with the index of 0xff.

Payload:

Byte(s)FormatDescription
0uint8Packet Type
1uint8Value Index

0x01 - Query Time

Requests the target send the current time in the local clock domain. The target responds with a Timestamp packet.

Payload: None

0x10 - Enable Reporting

Requests the target start sending Report packets.

Payload: None

0x11 - Disable Reporting

Requests the target stop sending Report packets.

Payload: None

0x20 - Set Output

Sets the indexed output to high/enabled (true) low/disabled (false). TODO(konkers): Add enumeration packets for outputs. Payload:

Byte(s)FormatDescription
0uint8Packet Type
1uint8Output Index
2boolOutput Value

0x80 - Report Format

Payload:

Byte(s)FormatDescription
0uint8Packet Type
1uint8Value Index
2uint8Value Type
3uint8Unit
4..7float32Scale
8..63stringName

0x81 - Report

Payload: One or more data reports of the following format. The length of each report is determined by the Report Format query responses. No partial reports will be included in a Report packet.

FieldFormatDescription
timestampuint64Timestamp, in microseconds, in the local clock domain.
value 0variableValue of the 0th field described by the Report Format packets.
.........
value nvariableValue of the nth field described by the Report Format packets.

0x82 - Timestamp

Payload:

FieldFormatDescription
timestampuint64Timestamp, in microseconds, in the local clock domain.