aboutsummaryrefslogtreecommitdiff
path: root/src/diller/serial.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/diller/serial.h')
-rw-r--r--src/diller/serial.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/diller/serial.h b/src/diller/serial.h
new file mode 100644
index 0000000..f80939e
--- /dev/null
+++ b/src/diller/serial.h
@@ -0,0 +1,44 @@
+#pragma once
+
+#include "diller/utils.h"
+#include "diller/core.h"
+
+namespace diller {
+namespace serial {
+
+using diller::utils::property;
+using diller::core::diller_error;
+using diller::core::property_action;
+
+template<typename d_core, typename io_t>
+class diller_serial : protected diller::core::property_action_listener {
+ public:
+ diller_serial(d_core &diller) : diller(diller), params(), diller_parser(params) {
+ }
+
+ void setup();
+ void loop();
+
+ private:
+ void process_command();
+ void on_property_action(const property *, property_action);
+
+ void cmd_network();
+ void cmd_wlan();
+ void cmd_wlan(const char* ssid, const char* password);
+ void cmd_property(const char *id, const char *value, const char *name);
+ void cmd_list_properties();
+ void show_status(wl_status_t wl_status);
+
+ d_core &diller;
+ diller::utils::fixed_size_key_value_map<10> params;
+ diller::utils::diller_parser diller_parser;
+ diller::utils::tty<io_t, 100, 1000> tty;
+
+ static const bool send_wlan_password = false;
+};
+
+} // namespace serial
+} // namespace diller
+
+#include "diller/serial_impl.h"