ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
esphome::ir_rf_base::IrRfCall< Call, Entity > Class Template Reference

Builder for a transmit; Call is the concrete call type and Entity its entity, so the fluent setters return the concrete type and control() sees the medium specific fields. More...

#include <ir_rf_base.h>

Inheritance diagram for esphome::ir_rf_base::IrRfCall< Call, Entity >:
esphome::ir_rf_base::IrRfCallData

Public Member Functions

Call & set_raw_timings (const std::vector< int32_t > &timings)
 Set the raw timings from a vector (positive = mark, negative = space)
 
Call & set_raw_timings_base64url (const std::string &base64url)
 Set the raw timings from base64url-encoded little-endian int32 data.
 
Call & set_raw_timings_packed (const uint8_t *data, uint16_t length, uint16_t count)
 Set the raw timings from packed protobuf sint32 data (zigzag + varint encoded)
 
Call & set_repeat_count (uint32_t count)
 Set the number of times to repeat transmission (1 = transmit once, 2 = transmit twice, etc.)
 
Call & set_api_connection (api::APIConnection *conn)
 Reply to this API client once the frame has left the transmitter (API 1.18+)
 
bool perform ()
 Perform the transmission; returns true if a frame was handed to the transmitter.
 
- Public Member Functions inherited from esphome::ir_rf_base::IrRfCallData
const std::vector< int32_t > & get_raw_timings () const
 Get the raw timings (only valid if set via set_raw_timings)
 
bool has_raw_timings () const
 Check if raw timings have been set (any format)
 
bool is_packed () const
 Check if using packed data format.
 
bool is_base64url () const
 Check if using base64url data format.
 
const std::string & get_base64url_data () const
 Get the base64url data string.
 
const uint8_t * get_packed_data () const
 Get packed data (only valid if set via set_raw_timings_packed)
 
uint16_t get_packed_length () const
 
uint16_t get_packed_count () const
 
uint32_t get_repeat_count () const
 Get the repeat count.
 
bool wants_api_reply () const
 True for a frame an API client is waiting on.
 

Protected Member Functions

Call & self_ ()
 

Protected Attributes

Entity * parent_
 
- Protected Attributes inherited from esphome::ir_rf_base::IrRfCallData
uint32_t repeat_count_ {1}
 
api::APIConnection * api_connection_ {nullptr}
 
const std::vector< int32_t > * raw_timings_ {nullptr}
 
const std::string * base64url_ptr_ {nullptr}
 
const uint8_t * packed_data_ {nullptr}
 
uint16_t packed_length_ {0}
 
uint16_t packed_count_ {0}
 

Detailed Description

template<typename Call, typename Entity>
class esphome::ir_rf_base::IrRfCall< Call, Entity >

Builder for a transmit; Call is the concrete call type and Entity its entity, so the fluent setters return the concrete type and control() sees the medium specific fields.

Definition at line 187 of file ir_rf_base.h.

Member Function Documentation

◆ perform()

template<typename Call , typename Entity >
bool esphome::ir_rf_base::IrRfCall< Call, Entity >::perform ( )
inline

Perform the transmission; returns true if a frame was handed to the transmitter.

Definition at line 247 of file ir_rf_base.h.

◆ self_()

template<typename Call , typename Entity >
Call & esphome::ir_rf_base::IrRfCall< Call, Entity >::self_ ( )
inlineprotected

Definition at line 268 of file ir_rf_base.h.

◆ set_api_connection()

template<typename Call , typename Entity >
Call & esphome::ir_rf_base::IrRfCall< Call, Entity >::set_api_connection ( api::APIConnection * conn)
inline

Reply to this API client once the frame has left the transmitter (API 1.18+)

Definition at line 240 of file ir_rf_base.h.

◆ set_raw_timings()

template<typename Call , typename Entity >
Call & esphome::ir_rf_base::IrRfCall< Call, Entity >::set_raw_timings ( const std::vector< int32_t > & timings)
inline

Set the raw timings from a vector (positive = mark, negative = space)

Note
Lifetime: Stores a pointer to the vector. The vector must outlive perform().
Usage: Primarily for lambdas/automations where the vector is in scope.

Definition at line 202 of file ir_rf_base.h.

◆ set_raw_timings_base64url()

template<typename Call , typename Entity >
Call & esphome::ir_rf_base::IrRfCall< Call, Entity >::set_raw_timings_base64url ( const std::string & base64url)
inline

Set the raw timings from base64url-encoded little-endian int32 data.

Note
Lifetime: Stores a pointer to the string. The string must outlive perform().
Usage: For web_server - base64url is fully URL-safe (uses '-' and '_').
Decoding happens at perform() time, directly into the transmit buffer.

Definition at line 213 of file ir_rf_base.h.

◆ set_raw_timings_packed()

template<typename Call , typename Entity >
Call & esphome::ir_rf_base::IrRfCall< Call, Entity >::set_raw_timings_packed ( const uint8_t * data,
uint16_t length,
uint16_t count )
inline

Set the raw timings from packed protobuf sint32 data (zigzag + varint encoded)

Note
Lifetime: Stores a pointer to the buffer. The buffer must outlive perform().
Usage: For API component where data comes directly from the protobuf message.

Definition at line 223 of file ir_rf_base.h.

◆ set_repeat_count()

template<typename Call , typename Entity >
Call & esphome::ir_rf_base::IrRfCall< Call, Entity >::set_repeat_count ( uint32_t count)
inline

Set the number of times to repeat transmission (1 = transmit once, 2 = transmit twice, etc.)

Definition at line 233 of file ir_rf_base.h.

Field Documentation

◆ parent_

template<typename Call , typename Entity >
Entity* esphome::ir_rf_base::IrRfCall< Call, Entity >::parent_
protected

Definition at line 270 of file ir_rf_base.h.


The documentation for this class was generated from the following file: