+ CAST_TO_VALUE_T(ds, vt, v32, data->scale, data->shift);
+ mb_submit(host, slave, data, vt);
+ } else if (data->register_type == REG_TYPE_UINT32_CDAB) {
+ uint32_t v32;
+ value_t vt;
+
+ v32 = (((uint32_t)values[1]) << 16) | ((uint32_t)values[0]);
+ DEBUG("Modbus plugin: mb_read_data: "
+ "Returned uint32 value is %" PRIu32,
+ v32);
+
+ CAST_TO_VALUE_T(ds, vt, v32, data->scale, data->shift);
+ mb_submit(host, slave, data, vt);
+ } else if (data->register_type == REG_TYPE_UINT64) {
+ uint64_t v64;
+ value_t vt;
+
+ v64 = (((uint64_t)values[0]) << 48) | (((uint64_t)values[1]) << 32) |
+ (((uint64_t)values[2]) << 16) | (((uint64_t)values[3]));
+ DEBUG("Modbus plugin: mb_read_data: "
+ "Returned uint64 value is %" PRIu64,
+ v64);
+
+ CAST_TO_VALUE_T(ds, vt, v64, data->scale, data->shift);
+ mb_submit(host, slave, data, vt);
+ } else if (data->register_type == REG_TYPE_INT64) {
+ union {
+ uint64_t u64;
+ int64_t i64;
+ } v;
+ value_t vt;
+
+ v.u64 = (((uint64_t)values[0]) << 48) | (((uint64_t)values[1]) << 32) |
+ (((uint64_t)values[2]) << 16) | ((uint64_t)values[3]);
+ DEBUG("Modbus plugin: mb_read_data: "
+ "Returned uint64 value is %" PRIi64,
+ v.i64);
+
+ CAST_TO_VALUE_T(ds, vt, v.i64, data->scale, data->shift);