From e0fc15d30085e813786fe028aec3fc5b7fb8c13e Mon Sep 17 00:00:00 2001 From: doinkythederp Date: Mon, 13 May 2024 11:40:23 -0700 Subject: [PATCH] Add battery protocol docs --- src/simulators/protocol.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/simulators/protocol.md b/src/simulators/protocol.md index 2c819de..bcc95ae 100644 --- a/src/simulators/protocol.md +++ b/src/simulators/protocol.md @@ -73,6 +73,8 @@ Commands are sent from the frontend to the backend and signal for specific actio - port: [AdiPort](#adiport) - voltage: float - `StartExecution`: Start executing user code. This should be treated as a no-op by the backend until it sends a `Ready` [`Event`](#events). +- `SetBatteryCapacity`: Updates the remaining battery capacity to a new Watt-Hours value. If this command is not sent, the simulator must default to a value of 14 Watt-Hours, the maximum capacity of the VEX V5 battery. This value may be used by the simulator to help calculate the voltage of the battery. Fields: + - capacity: float in Watt-Hours ## Data types @@ -210,6 +212,15 @@ Variants: - `Warn`: possible issues or errors that do not directly affect the simulation - `Error`: issues and errors that degrade the simulation +### Battery + +A struct containing information about the current state of the battery +Fields: + +- `voltage`: The output voltage of the battery. Float value in Volts. +- `current`: The current draw of the battery. Float value in Amps. +- `capacity`: The remaining energy capacity of the battery. Float value in Watt-Hours. + ## Notes - Rust implementation available at .