11 namespace remote_base {
19 std::copy_n(data.begin(), std::min(data.size(), this->
data_.size()), this->
data_.begin());
23 std::copy_n(data.begin(), std::min(data.size(), this->
data_.size()), this->
data_.begin());
27 const uint8_t *
data()
const {
return this->
data_.data(); }
43 template<
typename T> T
to()
const {
return T(*
this); }
48 uint8_t
get_value_(uint8_t idx, uint8_t mask = 255, uint8_t shift = 0)
const {
49 return (this->
data_[idx] >> shift) & mask;
51 void set_value_(uint8_t idx, uint8_t value, uint8_t mask = 255, uint8_t shift = 0) {
52 this->
data_[idx] &= ~(mask << shift);
53 this->
data_[idx] |= (value << shift);
73 TEMPLATABLE_VALUE(std::vector<uint8_t>, code)
MideaDataType type() const
std::string format_hex_pretty(const uint8_t *data, size_t length)
Format the byte array data of length len in pretty-printed, human-readable hex.
DECLARE_REMOTE_PROTOCOL(AEHA) template< typename... Ts > class AEHAAction
bool operator==(const MideaData &rhs) const
uint8_t & operator[](size_t idx)
bool is_compliment(const MideaData &rhs) const
void encode(RemoteTransmitData *dst, const MideaData &src) override
void set_value_(uint8_t idx, uint8_t value, uint8_t mask=255, uint8_t shift=0)
static const uint8_t OFFSET_CS
uint8_t get_value_(uint8_t idx, uint8_t mask=255, uint8_t shift=0) const
MideaData(std::initializer_list< uint8_t > data)
std::array< uint8_t, 6 > data_
const uint8_t & operator[](size_t idx) const
std::string to_string() const
void set_mask_(uint8_t idx, bool state, uint8_t mask=255)
Implementation of SPI Controller mode.
const uint8_t * data() const
MideaData(const std::vector< uint8_t > &data)