// The part of Arduino.h that AlexaDevice, AlexaCapability and AlexaLog use, for the host tests (pio test -e native): // String, Print and Serial. The program-memory helpers come from src/AlexaCompat.h. A board never sees this file. #ifndef ALEX2ESP_HOST_ARDUINO_H #define ALEX2ESP_HOST_ARDUINO_H #include #include #include #include #include #include "AlexaCompat.h" class String : public std::string { public: String() {} String(const char *text) : std::string(text != nullptr ? text : "") {} String(const std::string &text) : std::string(text) {} bool isEmpty() const { return empty(); } }; class Print { public: virtual ~Print() {} virtual size_t write(const uint8_t *buffer, size_t size) = 0; size_t print(const char *text) { return write(reinterpret_cast(text), strlen(text)); } size_t println(const char *text) { return print(text) + print("\r\n"); } }; class HostSerial : public Print { public: size_t write(const uint8_t *buffer, size_t size) override { return fwrite(buffer, 1, size, stdout); } }; inline HostSerial Serial; #endif // ALEX2ESP_HOST_ARDUINO_H