- if (data->modbus_register_type == MREG_INPUT){
- status = modbus_read_input_registers (host->connection,
- /* start_addr = */ data->register_base,
- /* num_registers = */ values_num, /* buffer = */ values);
- }
- else{
- status = modbus_read_registers (host->connection,
- /* start_addr = */ data->register_base,
- /* num_registers = */ values_num, /* buffer = */ values);
- }
- if (status != values_num)
- {
- ERROR ("Modbus plugin: modbus read function (%s/%s) failed. "
- " status = %i, values_num = %i. Giving up.",
- host->host, host->node, status, values_num);
+ if (data->modbus_register_type == MREG_INPUT) {
+ status = modbus_read_input_registers(host->connection,
+ /* start_addr = */ data->register_base,
+ /* num_registers = */ values_num,
+ /* buffer = */ values);
+ } else {
+ status = modbus_read_registers(host->connection,
+ /* start_addr = */ data->register_base,
+ /* num_registers = */ values_num,
+ /* buffer = */ values);
+ }
+ if (status != values_num) {
+ ERROR("Modbus plugin: modbus read function (%s/%s) failed. "
+ " status = %i, values_num = %i. Giving up.",
+ host->host, host->node, status, values_num);