mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 14:12:16 +03:00
37 lines
785 B
C++
37 lines
785 B
C++
#pragma once
|
|
#include <Arduino.h>
|
|
#include "classes/IoTItem.h"
|
|
|
|
#ifdef ESP8266
|
|
#include <SoftwareSerial.h>
|
|
#else
|
|
#include <HardwareSerial.h>
|
|
#include <SoftwareSerial.h>
|
|
#endif
|
|
|
|
|
|
class IoTUart : public IoTItem {
|
|
public:
|
|
IoTUart(const String& parameters);
|
|
~IoTUart();
|
|
|
|
virtual void uartHandle();
|
|
|
|
virtual void loop();
|
|
|
|
void uartPrintStrInUTF16(const char *strUTF8, int length);
|
|
void uartPrintln(const String& msg);
|
|
void uartPrint(const String& msg);
|
|
void uartPrintHex(const String& msg);
|
|
virtual IoTValue execute(String command, std::vector<IoTValue> ¶m);
|
|
|
|
protected:
|
|
#ifdef ESP8266
|
|
SoftwareSerial* _myUART;
|
|
#elif LIBRETINY
|
|
SerialClass* _myUART;
|
|
#else
|
|
Stream* _myUART;
|
|
#endif
|
|
|
|
}; |