-
Notifications
You must be signed in to change notification settings - Fork 0
/
modbus.h
31 lines (18 loc) · 963 Bytes
/
modbus.h
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
#pragma once
#include <modbus.h>
#include "types.h"
modbus_t *init_modbus_rtu();
void handle_modbus_rtu_rts(modbus_t *ctx, int32_t on);
data_result_t
handle_read_coil_status(modbus_t *modbus_ctx, uint16_t start_address, uint16_t quantity, data_t &answer_buffer);
data_result_t
handle_read_input_status(modbus_t *modbus_ctx, uint16_t start_address, uint16_t quantity, data_t &answer_buffer);
data_result_t
handle_read_holding_registers(modbus_t *modbus_ctx, uint16_t start_address, uint16_t quantity, data_t &answer_buffer);
data_result_t
handle_read_input_registers(modbus_t *modbus_ctx, uint16_t start_address, uint16_t quantity, data_t &answer_buffer);
data_result_t handle_force_single_coil();
data_result_t handle_preset_single_register();
data_result_t handle_force_multiple_coils();
data_result_t handle_preset_multiple_registers();
data_result_t handle_modbus_rtu(modbus_t *modbus_ctx, const data_view_t &request_view, data_t &answer_buffer);