Crate vexide_simulator_protocol

Source
Expand description

The Vexide Simulator Protocol enables communication between VEX robot simulators and user-facing frontends using a JSON-based protocol.

The code executor and frontend communicate over a stream in newline-delimited JSON format.

The backend sends Events which represent a change in simulator state. These are used by the frontend to correctly display the state of the simulated program.

The frontend sends Commands to the code executor to control the robot code environment, simulating changes in robot hardware (like controller input and LCD touch events) or competition phase.

The full protocol is documented at https://internals.vexide.dev/simulators/protocol.

Structs§

AdiPort
A 3-wire “ADI” port for analog devices.
Battery
Battery status and statistics.
Color
CompetitionMode
ControllerState
The raw state of a VEX V5 controller.
Rect
RobotState
The current state of the robot as a whole.
SerialData
SmartPort
An RJ9 4p4c “Smart” port on the VEX V5.
TextMetrics
V5Text
VCodeSig
Base64-encoded program metadata.

Enums§

Command
A message sent from the frontend to the simulator.
CompMode
The current stage of a competition.
ControllerUpdate
A method of retrieving a controller’s current state.
Device
The configuration of a V5 peripheral.
DeviceStatus
The current state of a V5 peripheral.
DrawCommand
An instruction for drawing to the robot LCD screen.
Event
A message sent from the simulator to the frontend.
LinkMode
The mode of a VEXlink-configured radio.
LogLevel
The importance level of a log message.
MotorBrakeMode
The brake mode of a VEX V5 motor.
MotorGearset
The gearset of a VEX V5 motor.
Port
An arbitrary port on the VEX V5.
ScrollLocation
Shape
A shape that can be drawn to the robot LCD screen.
TextLocation
TouchEvent
The gearset of a VEX V5 motor.
V5FontFamily
V5FontSize