Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches
hub_hooks.h File Reference

Injected-capability callback aliases shared by the hub's collaborator objects. More...

#include "proto_frame.h"
#include <cstdint>
#include <functional>
Include dependency graph for hub_hooks.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  esphome
namespace  esphome::home_io_control

Typedefs

using esphome::home_io_control::NamedTimeoutFn = std::function<void(const char *name, uint32_t delay_ms, std::function<void()> callback)>
 Schedules a named, replace-on-same-name timeout on the hub's ESPHome scheduler.
using esphome::home_io_control::TransmitFrameFn = std::function<bool(const IoFrame &frame, uint32_t freq_hz, uint16_t preamble)>
 Puts a frame on air on a given channel via the hub's protected transmit_frame_().
using esphome::home_io_control::BeginBlockingExcursionFn = std::function<void()>
 Raises the hub's "operation took a long time" warning threshold for a blocking radio excursion — writes Component::warn_if_blocking_over_, which is protected on ESPHome's Component.

Detailed Description

Injected-capability callback aliases shared by the hub's collaborator objects.

Several hub collaborators need a protected hub capability — Component::set_timeout() (protected in real ESPHome, only public in the host test stub), IOHomeControlComponent::transmit_frame_(), Component::warn_if_blocking_over_. Rather than granting friend, the hub injects a std::function for each, constructed as a lambda in its own member-initializer list, which has the access. This header holds only those aliases so the collaborator headers do not each redefine them. Dependency-light on purpose: it never includes hub_core.h.

Definition in file hub_hooks.h.