ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
esphome::remote_base::RCSwitchBase Class Reference

#include <rc_switch_protocol.h>

Public Types

using ProtocolData = RCSwitchData
 

Public Member Functions

constexpr RCSwitchBase ()=default
 
constexpr RCSwitchBase (uint32_t sync_high, uint32_t sync_low, uint32_t zero_high, uint32_t zero_low, uint32_t one_high, uint32_t one_low, bool inverted)
 
void one (RemoteTransmitData *dst) const
 
void zero (RemoteTransmitData *dst) const
 
void sync (RemoteTransmitData *dst) const
 
void transmit (RemoteTransmitData *dst, uint64_t code, uint8_t len) const
 
bool expect_one (RemoteReceiveData &src) const
 
bool expect_zero (RemoteReceiveData &src) const
 
bool expect_sync (RemoteReceiveData &src) const
 
bool decode (RemoteReceiveData &src, uint64_t *out_data, uint8_t *out_nbits) const
 
optional< RCSwitchData > decode (RemoteReceiveData &src) const
 

Static Public Member Functions

static void simple_code_to_tristate (uint16_t code, uint8_t nbits, uint64_t *out_code)
 
static void type_a_code (uint8_t switch_group, uint8_t switch_device, bool state, uint64_t *out_code, uint8_t *out_nbits)
 
static void type_b_code (uint8_t address_code, uint8_t channel_code, bool state, uint64_t *out_code, uint8_t *out_nbits)
 
static void type_c_code (uint8_t family, uint8_t group, uint8_t device, bool state, uint64_t *out_code, uint8_t *out_nbits)
 
static void type_d_code (uint8_t group, uint8_t device, bool state, uint64_t *out_code, uint8_t *out_nbits)
 

Protected Attributes

uint32_t sync_high_ {}
 
uint32_t sync_low_ {}
 
uint32_t zero_high_ {}
 
uint32_t zero_low_ {}
 
uint32_t one_high_ {}
 
uint32_t one_low_ {}
 
uint32_t inverted_ {}
 

Detailed Description

Definition at line 17 of file rc_switch_protocol.h.

Member Typedef Documentation

◆ ProtocolData

Constructor & Destructor Documentation

◆ RCSwitchBase() [1/2]

esphome::remote_base::RCSwitchBase::RCSwitchBase ( )
constexprdefault

◆ RCSwitchBase() [2/2]

esphome::remote_base::RCSwitchBase::RCSwitchBase ( uint32_t sync_high,
uint32_t sync_low,
uint32_t zero_high,
uint32_t zero_low,
uint32_t one_high,
uint32_t one_low,
bool inverted )
inlineconstexpr

Definition at line 22 of file rc_switch_protocol.h.

Member Function Documentation

◆ decode() [1/2]

optional< RCSwitchData > esphome::remote_base::RCSwitchBase::decode ( RemoteReceiveData & src) const

Definition at line 129 of file rc_switch_protocol.cpp.

◆ decode() [2/2]

bool esphome::remote_base::RCSwitchBase::decode ( RemoteReceiveData & src,
uint64_t * out_data,
uint8_t * out_nbits ) const

Definition at line 111 of file rc_switch_protocol.cpp.

◆ expect_one()

bool esphome::remote_base::RCSwitchBase::expect_one ( RemoteReceiveData & src) const

Definition at line 63 of file rc_switch_protocol.cpp.

◆ expect_sync()

bool esphome::remote_base::RCSwitchBase::expect_sync ( RemoteReceiveData & src) const

Definition at line 93 of file rc_switch_protocol.cpp.

◆ expect_zero()

bool esphome::remote_base::RCSwitchBase::expect_zero ( RemoteReceiveData & src) const

Definition at line 78 of file rc_switch_protocol.cpp.

◆ one()

void esphome::remote_base::RCSwitchBase::one ( RemoteTransmitData * dst) const

Definition at line 24 of file rc_switch_protocol.cpp.

◆ simple_code_to_tristate()

void esphome::remote_base::RCSwitchBase::simple_code_to_tristate ( uint16_t code,
uint8_t nbits,
uint64_t * out_code )
static

Definition at line 143 of file rc_switch_protocol.cpp.

◆ sync()

void esphome::remote_base::RCSwitchBase::sync ( RemoteTransmitData * dst) const

Definition at line 42 of file rc_switch_protocol.cpp.

◆ transmit()

void esphome::remote_base::RCSwitchBase::transmit ( RemoteTransmitData * dst,
uint64_t code,
uint8_t len ) const

Definition at line 51 of file rc_switch_protocol.cpp.

◆ type_a_code()

void esphome::remote_base::RCSwitchBase::type_a_code ( uint8_t switch_group,
uint8_t switch_device,
bool state,
uint64_t * out_code,
uint8_t * out_nbits )
static

Definition at line 154 of file rc_switch_protocol.cpp.

◆ type_b_code()

void esphome::remote_base::RCSwitchBase::type_b_code ( uint8_t address_code,
uint8_t channel_code,
bool state,
uint64_t * out_code,
uint8_t * out_nbits )
static

Definition at line 165 of file rc_switch_protocol.cpp.

◆ type_c_code()

void esphome::remote_base::RCSwitchBase::type_c_code ( uint8_t family,
uint8_t group,
uint8_t device,
bool state,
uint64_t * out_code,
uint8_t * out_nbits )
static

Definition at line 183 of file rc_switch_protocol.cpp.

◆ type_d_code()

void esphome::remote_base::RCSwitchBase::type_d_code ( uint8_t group,
uint8_t device,
bool state,
uint64_t * out_code,
uint8_t * out_nbits )
static

Definition at line 201 of file rc_switch_protocol.cpp.

◆ zero()

void esphome::remote_base::RCSwitchBase::zero ( RemoteTransmitData * dst) const

Definition at line 33 of file rc_switch_protocol.cpp.

Field Documentation

◆ inverted_

uint32_t esphome::remote_base::RCSwitchBase::inverted_ {}
protected

Definition at line 70 of file rc_switch_protocol.h.

◆ one_high_

uint32_t esphome::remote_base::RCSwitchBase::one_high_ {}
protected

Definition at line 68 of file rc_switch_protocol.h.

◆ one_low_

uint32_t esphome::remote_base::RCSwitchBase::one_low_ {}
protected

Definition at line 69 of file rc_switch_protocol.h.

◆ sync_high_

uint32_t esphome::remote_base::RCSwitchBase::sync_high_ {}
protected

Definition at line 64 of file rc_switch_protocol.h.

◆ sync_low_

uint32_t esphome::remote_base::RCSwitchBase::sync_low_ {}
protected

Definition at line 65 of file rc_switch_protocol.h.

◆ zero_high_

uint32_t esphome::remote_base::RCSwitchBase::zero_high_ {}
protected

Definition at line 66 of file rc_switch_protocol.h.

◆ zero_low_

uint32_t esphome::remote_base::RCSwitchBase::zero_low_ {}
protected

Definition at line 67 of file rc_switch_protocol.h.


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