ESPHome 2026.1.0-dev
Loading...
Searching...
No Matches
esphome::infrared::InfraredCall Class Reference

InfraredCall - Builder pattern for transmitting infrared signals. More...

#include <infrared.h>

Public Member Functions

 InfraredCall (Infrared *parent)
 
InfraredCallset_carrier_frequency (uint32_t frequency)
 Set the carrier frequency in Hz.
 
InfraredCallset_raw_timings (const std::vector< int32_t > &timings)
 Set the raw timings (positive = mark, negative = space) Note: The timings vector must outlive the InfraredCall (zero-copy reference)
 
InfraredCallset_raw_timings_packed (const uint8_t *data, uint16_t length, uint16_t count)
 Set the raw timings from packed protobuf sint32 data (zero-copy from wire) Note: The data must outlive the InfraredCall.
 
InfraredCallset_repeat_count (uint32_t count)
 Set the number of times to repeat transmission (1 = transmit once, 2 = transmit twice, etc.)
 
void perform ()
 Perform the transmission.
 
const optional< uint32_t > & get_carrier_frequency () const
 Get the carrier frequency.
 
const std::vector< int32_t > & get_raw_timings () const
 Get the raw timings (only valid if set via set_raw_timings, not packed)
 
bool has_raw_timings () const
 Check if raw timings have been set (either vector or packed)
 
bool is_packed () const
 Check if using packed data format.
 
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.
 

Protected Attributes

uint32_t repeat_count_ {1}
 
Infraredparent_
 
optional< uint32_t > carrier_frequency_
 
const std::vector< int32_t > * raw_timings_ {nullptr}
 
const uint8_t * packed_data_ {nullptr}
 
uint16_t packed_length_ {0}
 
uint16_t packed_count_ {0}
 

Detailed Description

InfraredCall - Builder pattern for transmitting infrared signals.

Definition at line 25 of file infrared.h.

Constructor & Destructor Documentation

◆ InfraredCall()

esphome::infrared::InfraredCall::InfraredCall ( Infrared * parent)
inlineexplicit

Definition at line 27 of file infrared.h.

Member Function Documentation

◆ get_carrier_frequency()

const optional< uint32_t > & esphome::infrared::InfraredCall::get_carrier_frequency ( ) const
inline

Get the carrier frequency.

Definition at line 44 of file infrared.h.

◆ get_packed_count()

uint16_t esphome::infrared::InfraredCall::get_packed_count ( ) const
inline

Definition at line 54 of file infrared.h.

◆ get_packed_data()

const uint8_t * esphome::infrared::InfraredCall::get_packed_data ( ) const
inline

Get packed data (only valid if set via set_raw_timings_packed)

Definition at line 52 of file infrared.h.

◆ get_packed_length()

uint16_t esphome::infrared::InfraredCall::get_packed_length ( ) const
inline

Definition at line 53 of file infrared.h.

◆ get_raw_timings()

const std::vector< int32_t > & esphome::infrared::InfraredCall::get_raw_timings ( ) const
inline

Get the raw timings (only valid if set via set_raw_timings, not packed)

Definition at line 46 of file infrared.h.

◆ get_repeat_count()

uint32_t esphome::infrared::InfraredCall::get_repeat_count ( ) const
inline

Get the repeat count.

Definition at line 56 of file infrared.h.

◆ has_raw_timings()

bool esphome::infrared::InfraredCall::has_raw_timings ( ) const
inline

Check if raw timings have been set (either vector or packed)

Definition at line 48 of file infrared.h.

◆ is_packed()

bool esphome::infrared::InfraredCall::is_packed ( ) const
inline

Check if using packed data format.

Definition at line 50 of file infrared.h.

◆ perform()

void esphome::infrared::InfraredCall::perform ( )

Perform the transmission.

Definition at line 38 of file infrared.cpp.

◆ set_carrier_frequency()

InfraredCall & esphome::infrared::InfraredCall::set_carrier_frequency ( uint32_t frequency)

Set the carrier frequency in Hz.

Definition at line 14 of file infrared.cpp.

◆ set_raw_timings()

InfraredCall & esphome::infrared::InfraredCall::set_raw_timings ( const std::vector< int32_t > & timings)

Set the raw timings (positive = mark, negative = space) Note: The timings vector must outlive the InfraredCall (zero-copy reference)

Definition at line 19 of file infrared.cpp.

◆ set_raw_timings_packed()

InfraredCall & esphome::infrared::InfraredCall::set_raw_timings_packed ( const uint8_t * data,
uint16_t length,
uint16_t count )

Set the raw timings from packed protobuf sint32 data (zero-copy from wire) Note: The data must outlive the InfraredCall.

Definition at line 25 of file infrared.cpp.

◆ set_repeat_count()

InfraredCall & esphome::infrared::InfraredCall::set_repeat_count ( uint32_t count)

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

Definition at line 33 of file infrared.cpp.

Field Documentation

◆ carrier_frequency_

optional<uint32_t> esphome::infrared::InfraredCall::carrier_frequency_
protected

Definition at line 61 of file infrared.h.

◆ packed_count_

uint16_t esphome::infrared::InfraredCall::packed_count_ {0}
protected

Definition at line 67 of file infrared.h.

◆ packed_data_

const uint8_t* esphome::infrared::InfraredCall::packed_data_ {nullptr}
protected

Definition at line 65 of file infrared.h.

◆ packed_length_

uint16_t esphome::infrared::InfraredCall::packed_length_ {0}
protected

Definition at line 66 of file infrared.h.

◆ parent_

Infrared* esphome::infrared::InfraredCall::parent_
protected

Definition at line 60 of file infrared.h.

◆ raw_timings_

const std::vector<int32_t>* esphome::infrared::InfraredCall::raw_timings_ {nullptr}
protected

Definition at line 63 of file infrared.h.

◆ repeat_count_

uint32_t esphome::infrared::InfraredCall::repeat_count_ {1}
protected

Definition at line 59 of file infrared.h.


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