#pragma once

#include "esphome/core/hal.h"
#include "esphome/core/log.h"
#include <vector>
#include <string>

#ifndef UART_LOG_CHUNK_SIZE
#define UART_LOG_CHUNK_SIZE 120
#endif

namespace esphome {
namespace panasonic_heatpump {
enum UartLogDirection : uint8_t {
  UART_LOG_RX,
  UART_LOG_TX,
};

class PanasonicHelpers {
 public:
  static void write_uart_log(UartLogDirection direction, const std::vector<uint8_t>& data, const char separator,
                             bool logBytes);
  static void write_uart_log(UartLogDirection direction, const uint8_t* data, const size_t length, const char separator,
                             bool logBytes);
  static std::string byte_array_to_hex_string(const std::vector<uint8_t>& data, const char separator);
  static std::string byte_array_to_hex_string(const uint8_t* data, const size_t length, const char separator);
};
}  // namespace panasonic_heatpump
}  // namespace esphome
