Skip to main content

USB Serial

The USB Serial API enables bidirectional serial communication over USB at a fixed baud rate of 115200. This API automatically manages connection and disconnection states, providing reliable serial data transfer for device communication.

Configuration Details
  • Baud Rate: Fixed at 115200 bps

Protocol Buffer Definition

syntax = "proto3";
import "google/protobuf/empty.proto";

service SerialService {
// Streams incoming serial data from the USB port
rpc ReadFromSerialPortStream (google.protobuf.Empty) returns (stream SerialValue);

// Streams outgoing serial data to the USB port
rpc WriteToSerialPortStream (stream SerialValue) returns (google.protobuf.Empty);
}

// Serial data container
message SerialValue {
string data = 1; // UTF-8 encoded string data
}