ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
pioneer_wyt_protocol.cpp
Go to the documentation of this file.
3#include "esphome/core/log.h"
4
5namespace esphome::remote_base {
6
7ESPHOME_LOG_TAG(TAG, "remote.pioneer_wyt");
8
9// The timings and frame header are shared with tcl112
10static constexpr uint32_t HEADER_MARK_US = 3100;
11static constexpr uint32_t HEADER_SPACE_US = 1650;
12static constexpr uint32_t BIT_MARK_US = 500;
13static constexpr uint32_t BIT_ONE_SPACE_US = 1100;
14static constexpr uint32_t BIT_ZERO_SPACE_US = 350;
15
18 ESP_LOGD(TAG, "Transmit PioneerWyt: %s", format_hex_pretty_to(hex_buf, data.data(), data.size()));
19 dst->set_carrier_frequency(38000);
20 // header mark and space, a mark and space per bit, then the trailing mark
21 dst->reserve(dst->get_data().size() + 3 + PioneerWytData::SIZE * 8 * 2);
22 dst->item(HEADER_MARK_US, HEADER_SPACE_US);
23 for (uint8_t i = 0; i < data.size(); i++) {
24 for (uint8_t b = 0; b < 8; b++)
25 dst->item(BIT_MARK_US, (data[i] & (1 << b)) ? BIT_ONE_SPACE_US : BIT_ZERO_SPACE_US);
26 }
27 dst->mark(BIT_MARK_US);
28}
29
30} // namespace esphome::remote_base
void encode(RemoteTransmitData *dst, const PioneerWytData &data)
void set_carrier_frequency(uint32_t carrier_frequency)
Definition remote_base.h:31
void item(uint32_t mark, uint32_t space)
Definition remote_base.h:26
const RawTimings & get_data() const
Definition remote_base.h:33
ESPHOME_LOG_TAG(TAG, "remote.abbwelcome")
char * format_hex_pretty_to(char *buffer, size_t buffer_size, const uint8_t *data, size_t length, char separator)
Format byte array as uppercase hex to buffer (base implementation).
Definition helpers.cpp:498
constexpr size_t format_hex_pretty_size(size_t byte_count)
Calculate buffer size needed for format_hex_pretty_to with separator: "XX:XX:...:XX\0".
Definition helpers.h:1533
static void uint32_t