21#ifndef LSH_CORE_COMMUNICATION_BRIDGE_SERIAL_HPP
22#define LSH_CORE_COMMUNICATION_BRIDGE_SERIAL_HPP
46[[nodiscard]]
auto canPing() -> bool;
Declares the function that deserializes and dispatches commands received from lsh-bridge.
Controller-side serial link used to exchange payloads with lsh-bridge.
Definition bridge_serial.cpp:32
void init()
Initialize the serial port used to talk with lsh-bridge.
Definition bridge_serial.cpp:67
auto canPing() -> bool
Check whether the bridge link may emit another heartbeat.
Definition bridge_serial.cpp:229
uint16_t receiveIdleAge_ms
Elapsed idle time since the last valid payload was received, saturated at 65535 ms.
Definition bridge_serial.cpp:39
void updateLastSentTime()
Record that a payload has just been transmitted to the bridge.
Definition bridge_serial.cpp:242
auto isConnected() -> bool
Check whether the bridge is still considered connected.
Definition bridge_serial.cpp:259
void tickSendIdleTimer(uint16_t elapsed_ms)
Advance the ping idle timer used by canPing().
Definition bridge_serial.cpp:211
auto receiveAndDispatch(uint16_t maxBytesToConsume) -> ReceiveResult
Consume a bounded amount of serial input and dispatch at most one payload.
Definition bridge_serial.cpp:81
Definition bridge_serial.hpp:34
Deserializer::DispatchResult dispatch
Effects produced by one successfully dispatched payload.
Definition bridge_serial.hpp:35
uint16_t consumedBytes
Raw UART bytes consumed during this receive attempt.
Definition bridge_serial.hpp:36
bool payloadDispatched
True only when one full payload was parsed and dispatched.
Definition bridge_serial.hpp:37
Represents the result of a dispatch operation.
Definition deserializer.hpp:36