ESPHome  2024.11.2
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
esphome::remote_base::MideaData Class Reference

#include <midea_protocol.h>

Inheritance diagram for esphome::remote_base::MideaData:
esphome::midea::IrFollowMeData esphome::midea::IrSpecialData esphome::midea_ir::ControlData esphome::midea_ir::FollowMeData esphome::midea_ir::SpecialData

Public Types

enum  MideaDataType : uint8_t { MIDEA_TYPE_CONTROL = 0xA1, MIDEA_TYPE_SPECIAL = 0xA2, MIDEA_TYPE_FOLLOW_ME = 0xA4 }
 

Public Member Functions

 MideaData ()
 
 MideaData (std::initializer_list< uint8_t > data)
 
 MideaData (const std::vector< uint8_t > &data)
 
uint8_t * data ()
 
const uint8_t * data () const
 
uint8_t size () const
 
bool is_valid () const
 
void finalize ()
 
bool is_compliment (const MideaData &rhs) const
 
std::string to_string () const
 
bool operator== (const MideaData &rhs) const
 
MideaDataType type () const
 
template<typename T >
to () const
 
uint8_t & operator[] (size_t idx)
 
const uint8_t & operator[] (size_t idx) const
 

Protected Member Functions

uint8_t get_value_ (uint8_t idx, uint8_t mask=255, uint8_t shift=0) const
 
void set_value_ (uint8_t idx, uint8_t value, uint8_t mask=255, uint8_t shift=0)
 
void set_mask_ (uint8_t idx, bool state, uint8_t mask=255)
 
uint8_t calc_cs_ () const
 

Protected Attributes

std::array< uint8_t, 6 > data_
 

Static Protected Attributes

static const uint8_t OFFSET_CS = 5
 

Detailed Description

Definition at line 13 of file midea_protocol.h.

Member Enumeration Documentation

◆ MideaDataType

Enumerator
MIDEA_TYPE_CONTROL 
MIDEA_TYPE_SPECIAL 
MIDEA_TYPE_FOLLOW_ME 

Definition at line 37 of file midea_protocol.h.

Constructor & Destructor Documentation

◆ MideaData() [1/3]

esphome::remote_base::MideaData::MideaData ( )
inline

Definition at line 16 of file midea_protocol.h.

◆ MideaData() [2/3]

esphome::remote_base::MideaData::MideaData ( std::initializer_list< uint8_t >  data)
inline

Definition at line 18 of file midea_protocol.h.

◆ MideaData() [3/3]

esphome::remote_base::MideaData::MideaData ( const std::vector< uint8_t > &  data)
inline

Definition at line 22 of file midea_protocol.h.

Member Function Documentation

◆ calc_cs_()

uint8_t esphome::remote_base::MideaData::calc_cs_ ( ) const
protected

Definition at line 18 of file midea_protocol.cpp.

◆ data() [1/2]

uint8_t* esphome::remote_base::MideaData::data ( )
inline

Definition at line 26 of file midea_protocol.h.

◆ data() [2/2]

const uint8_t* esphome::remote_base::MideaData::data ( ) const
inline

Definition at line 27 of file midea_protocol.h.

◆ finalize()

void esphome::remote_base::MideaData::finalize ( )
inline

Definition at line 30 of file midea_protocol.h.

◆ get_value_()

uint8_t esphome::remote_base::MideaData::get_value_ ( uint8_t  idx,
uint8_t  mask = 255,
uint8_t  shift = 0 
) const
inlineprotected

Definition at line 48 of file midea_protocol.h.

◆ is_compliment()

bool esphome::remote_base::MideaData::is_compliment ( const MideaData rhs) const

Definition at line 25 of file midea_protocol.cpp.

◆ is_valid()

bool esphome::remote_base::MideaData::is_valid ( ) const
inline

Definition at line 29 of file midea_protocol.h.

◆ operator==()

bool esphome::remote_base::MideaData::operator== ( const MideaData rhs) const
inline

Definition at line 34 of file midea_protocol.h.

◆ operator[]() [1/2]

uint8_t& esphome::remote_base::MideaData::operator[] ( size_t  idx)
inline

Definition at line 44 of file midea_protocol.h.

◆ operator[]() [2/2]

const uint8_t& esphome::remote_base::MideaData::operator[] ( size_t  idx) const
inline

Definition at line 45 of file midea_protocol.h.

◆ set_mask_()

void esphome::remote_base::MideaData::set_mask_ ( uint8_t  idx,
bool  state,
uint8_t  mask = 255 
)
inlineprotected

Definition at line 55 of file midea_protocol.h.

◆ set_value_()

void esphome::remote_base::MideaData::set_value_ ( uint8_t  idx,
uint8_t  value,
uint8_t  mask = 255,
uint8_t  shift = 0 
)
inlineprotected

Definition at line 51 of file midea_protocol.h.

◆ size()

uint8_t esphome::remote_base::MideaData::size ( ) const
inline

Definition at line 28 of file midea_protocol.h.

◆ to()

template<typename T >
T esphome::remote_base::MideaData::to ( ) const
inline

Definition at line 43 of file midea_protocol.h.

◆ to_string()

std::string esphome::remote_base::MideaData::to_string ( ) const
inline

Definition at line 32 of file midea_protocol.h.

◆ type()

MideaDataType esphome::remote_base::MideaData::type ( ) const
inline

Definition at line 42 of file midea_protocol.h.

Field Documentation

◆ data_

std::array<uint8_t, 6> esphome::remote_base::MideaData::data_
protected

Definition at line 58 of file midea_protocol.h.

◆ OFFSET_CS

const uint8_t esphome::remote_base::MideaData::OFFSET_CS = 5
staticprotected

Definition at line 56 of file midea_protocol.h.


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