Ocky Kristanto / NextionSerial
Revision:
0:87b7b2ae63c3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/NextionSerial.h	Wed Mar 03 09:01:07 2021 +0100
@@ -0,0 +1,24 @@
+#pragma once
+
+#include "mbed.h"
+
+#include <vector>
+
+class NextionUI;
+
+class NextionSerial 
+{
+public:
+    explicit NextionSerial(PinName aTxPin, PinName aRxPin, int aBaud);
+
+    bool GetCurrentDualStateButton(const std::string& aObjectName);
+    void AddNextionUI(NextionUI* aNextionUI);
+
+private:
+    void SerialLoop();
+
+private:
+    BufferedSerial iNextionSerial;
+    std::vector<NextionUI*> iNextionUiElements;
+    Thread serialThread;
+};
\ No newline at end of file