#pragma once
#include <vector>

namespace myapp::modbus {

class data_access
{
public:
    virtual ~data_access() = default;

    virtual std::vector<uint8_t> read_coils(int slave_id, int starting_address, int quantity) = 0;
    virtual std::vector<uint8_t> read_discrete_inputs(int slave_id, int starting_address, int quantity) = 0;
    virtual std::vector<uint16_t> read_holding_registers(int slave_id, int starting_address, int quantity) = 0;
    virtual std::vector<uint16_t> read_input_registers(int slave_id, int starting_address, int quantity) = 0;

    virtual void write_single_coil(int slave_id, int address, uint8_t value) = 0;
    virtual void write_single_register(int slave_id, int address, uint16_t value) = 0;
    virtual void write_multiple_coils(int slave_id, int starting_address, std::vector<uint8_t> values) = 0;
    virtual void write_multiple_registers(int slave_id, int starting_address, std::vector<uint16_t> values) = 0;

    virtual std::vector<uint16_t> read_write_multiple_registers(int slave_id,
        int read_starting_address, int quantity_to_read,
        int write_starting_address, std::vector<uint16_t> values_to_write) = 0;
};

} /* namespace myapp::modbus */
