aboutsummaryrefslogtreecommitdiff
path: root/src/p18/client.h
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2021-05-07 02:18:07 +0300
committerEvgeny Zinoviev <me@ch1p.io>2021-05-07 02:18:07 +0300
commit7e743b73433475df086fcec81be7b10c1d695a42 (patch)
tree1737c5f9bdad2a40f740e9a655e510641331b9e2 /src/p18/client.h
initial
Diffstat (limited to 'src/p18/client.h')
-rw-r--r--src/p18/client.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/p18/client.h b/src/p18/client.h
new file mode 100644
index 0000000..8307bbb
--- /dev/null
+++ b/src/p18/client.h
@@ -0,0 +1,31 @@
+// SPDX-License-Identifier: BSD-3-Clause
+
+#ifndef INVERTER_TOOLS_P18_CLIENT_H_
+#define INVERTER_TOOLS_P18_CLIENT_H_
+
+#include "../voltronic/device.h"
+#include "types.h"
+#include "response.h"
+
+#include <memory>
+#include <vector>
+#include <string>
+
+
+namespace p18 {
+
+class Client {
+private:
+ std::shared_ptr<voltronic::Device> device_;
+ static std::string packArguments(p18::CommandType commandType, std::vector<std::string>& arguments);
+
+public:
+ void setDevice(std::shared_ptr<voltronic::Device> device);
+ std::shared_ptr<response_type::BaseResponse> execute(p18::CommandType commandType, std::vector<std::string>& arguments);
+ std::pair<std::shared_ptr<char>, size_t> runOnDevice(std::string& raw);
+};
+
+}
+
+
+#endif //INVERTER_TOOLS_P18_CLIENT_H_