summaryrefslogtreecommitdiff
path: root/src/p18/client.h
blob: 8307bbb00844e882fa3a0525b9a88a0f60227f47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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_