Home IO Control
ESPHome add-on for IO-Homecontrol devices
Toggle main menu visibility
Loading...
Searching...
No Matches
transmit_observer.h
Go to the documentation of this file.
1
#pragma once
2
3
/// @file transmit_observer.h
4
/// @brief Observer interface for every frame the exchange engine puts on air.
5
/// @ingroup hioc_hub
6
///
7
/// ExchangeEngine::transmit_frame() is the single TX choke point of the hub: 2W exchanges,
8
/// pairing, and 1W bursts all transmit through it. A TransmitObserver attached to the engine sees
9
/// each listen-before-talk deferral and each frame the radio accepted, without the engine knowing
10
/// who is listening or why. PairingTelemetry is the observer during a pairing attempt.
11
12
#include "
proto_frame.h
"
13
#include "
radio_interface.h
"
14
15
#include <cstdint>
16
17
namespace
esphome
{
18
namespace
home_io_control
{
19
20
/// @brief Receives transmit events from ExchangeEngine::transmit_frame().
21
///
22
/// Both callbacks default to no-ops, so an observer overrides only what it records. They run
23
/// synchronously inside transmit_frame(), on the main loop: keep them cheap and never transmit
24
/// from one.
25
class
TransmitObserver
{
26
public
:
27
virtual
~TransmitObserver
() =
default
;
28
29
/// The channel was busy, so transmit_frame() backs off once before trying again.
30
/// @param rssi_dbm The RSSI reading that deferred the transmit.
31
virtual
void
on_lbt_defer
(int16_t rssi_dbm) {}
32
33
/// The radio accepted a frame for transmission (send_packet() returned true). Not called when
34
/// serialization or send_packet() fails.
35
/// @param frame The logical frame that was sent.
36
/// @param config The TX shape it was sent with (frequency, preamble length).
37
/// @param wire_len Serialized length in bytes as handed to the radio.
38
virtual
void
on_transmit
(
const
IoFrame
&frame,
const
RadioTxConfig
&config, uint8_t wire_len) {}
39
};
40
41
}
// namespace home_io_control
42
}
// namespace esphome
esphome::home_io_control::TransmitObserver
Receives transmit events from ExchangeEngine::transmit_frame().
Definition
transmit_observer.h:25
esphome::home_io_control::TransmitObserver::on_lbt_defer
virtual void on_lbt_defer(int16_t rssi_dbm)
The channel was busy, so transmit_frame() backs off once before trying again.
Definition
transmit_observer.h:31
esphome::home_io_control::TransmitObserver::on_transmit
virtual void on_transmit(const IoFrame &frame, const RadioTxConfig &config, uint8_t wire_len)
The radio accepted a frame for transmission (send_packet() returned true).
Definition
transmit_observer.h:38
esphome::home_io_control::TransmitObserver::~TransmitObserver
virtual ~TransmitObserver()=default
esphome::home_io_control
Definition
device_registry.cpp:13
esphome
Definition
device_registry.cpp:12
proto_frame.h
IO-Homecontrol 2W frame container: control bytes, IoFrame and (de)serialization.
radio_interface.h
Radio abstraction layer for IO-Homecontrol.
esphome::home_io_control::IoFrame
Parsed IO‑Homecontrol frame (CTRL0/1 + addresses + command + data).
Definition
proto_frame.h:93
esphome::home_io_control::RadioTxConfig
Configuration for transmitting a packet: carrier frequency and preamble length.
Definition
radio_interface.h:109
components
home_io_control
transmit_observer.h
Generated by
1.18.0