mirror of
https://github.com/GrKoR/esphome_aux_ac_component.git
synced 2025-12-07 12:07:04 +03:00
30 lines
716 B
C++
30 lines
716 B
C++
#pragma once
|
|
|
|
#include "esphome/core/component.h"
|
|
#include "esphome/components/uart/uart.h"
|
|
|
|
#define AC_BUFFER_SIZE 35
|
|
|
|
using namespace esphome::uart;
|
|
|
|
namespace esphome
|
|
{
|
|
namespace aux_ac
|
|
{
|
|
class AuxUart : public UARTDevice
|
|
{
|
|
public:
|
|
AuxUart() = delete;
|
|
explicit AuxUart(UARTComponent *parent) : UARTDevice(parent) {}
|
|
~AuxUart() = default;
|
|
|
|
void send_frame(const std::vector<uint8_t> &frame);
|
|
bool read_frame(std::vector<uint8_t> &frame);
|
|
|
|
protected:
|
|
// Internal buffer for incoming data
|
|
uint8_t _data[AC_BUFFER_SIZE];
|
|
};
|
|
|
|
} // namespace aux_ac
|
|
} // namespace esphome
|