LSH-Core
Deterministic firmware core for Controllino-based Labo Smart Home nodes
 
Loading...
Searching...
No Matches
bridge_serial.cpp File Reference

Implements the serial communication logic, including sending and receiving data. More...

Include dependency graph for bridge_serial.cpp:

Namespaces

namespace  BridgeSerial
 Controller-side serial link used to exchange payloads with lsh-bridge.
 

Functions

void BridgeSerial::init ()
 Initialize the serial port used to talk with lsh-bridge.
 
auto BridgeSerial::receiveAndDispatch (uint16_t maxBytesToConsume) -> ReceiveResult
 Consume a bounded amount of serial input and dispatch at most one payload.
 
void BridgeSerial::tickSendIdleTimer (uint16_t elapsed_ms)
 Advance the ping idle timer used by canPing().
 
auto BridgeSerial::canPing () -> bool
 Check whether the bridge link may emit another heartbeat.
 
void BridgeSerial::updateLastSentTime ()
 Record that a payload has just been transmitted to the bridge.
 
auto BridgeSerial::isConnected () -> bool
 Check whether the bridge is still considered connected.
 

Variables

uint16_t BridgeSerial::sendIdleAge_ms = UINT16_MAX
 Elapsed idle time since the last payload was sent, saturated at 65535 ms.
 
uint16_t BridgeSerial::receiveIdleAge_ms = UINT16_MAX
 Elapsed idle time since the last valid payload was received, saturated at 65535 ms.
 

Detailed Description

Implements the serial communication logic, including sending and receiving data.

Author
Jacopo Labardi (labodj)

Copyright 2026 Jacopo Labardi

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.