ESPHome  2024.3.2
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes
esphome::remote_base::RCSwitchBase Class Reference

#include <rc_switch_protocol.h>

Public Types

using ProtocolData = RCSwitchData
 

Public Member Functions

 RCSwitchBase ()=default
 
 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< RCSwitchDatadecode (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_ {}
 
bool inverted_ {}
 

Detailed Description

Definition at line 16 of file rc_switch_protocol.h.

Member Typedef Documentation

◆ ProtocolData

Definition at line 18 of file rc_switch_protocol.h.

Constructor & Destructor Documentation

◆ RCSwitchBase() [1/2]

esphome::remote_base::RCSwitchBase::RCSwitchBase ( )
default

◆ 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 
)

Definition at line 19 of file rc_switch_protocol.cpp.

Member Function Documentation

◆ decode() [1/2]

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

Definition at line 116 of file rc_switch_protocol.cpp.

◆ decode() [2/2]

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

Definition at line 134 of file rc_switch_protocol.cpp.

◆ expect_one()

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

Definition at line 68 of file rc_switch_protocol.cpp.

◆ expect_sync()

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

Definition at line 98 of file rc_switch_protocol.cpp.

◆ expect_zero()

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

Definition at line 83 of file rc_switch_protocol.cpp.

◆ one()

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

Definition at line 29 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 148 of file rc_switch_protocol.cpp.

◆ sync()

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

Definition at line 47 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 56 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 159 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 170 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 188 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 206 of file rc_switch_protocol.cpp.

◆ zero()

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

Definition at line 38 of file rc_switch_protocol.cpp.

Field Documentation

◆ inverted_

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

Definition at line 62 of file rc_switch_protocol.h.

◆ one_high_

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

Definition at line 60 of file rc_switch_protocol.h.

◆ one_low_

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

Definition at line 61 of file rc_switch_protocol.h.

◆ sync_high_

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

Definition at line 56 of file rc_switch_protocol.h.

◆ sync_low_

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

Definition at line 57 of file rc_switch_protocol.h.

◆ zero_high_

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

Definition at line 58 of file rc_switch_protocol.h.

◆ zero_low_

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

Definition at line 59 of file rc_switch_protocol.h.


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