+ else if (data->register_type == REG_TYPE_INT32)
+ {
+ union
+ {
+ uint32_t u32;
+ int32_t i32;
+ } v;
+ value_t vt;
+
+ v.u32 = (((uint32_t) values[0]) << 16)
+ | ((uint32_t) values[1]);
+ DEBUG ("Modbus plugin: mb_read_data: "
+ "Returned int32 value is %"PRIi32, v.i32);
+
+ CAST_TO_VALUE_T (ds, vt, v.i32);
+ mb_submit (host, slave, data, vt);
+ }
+ else if (data->register_type == REG_TYPE_INT16)
+ {
+ union
+ {
+ uint16_t u16;
+ int16_t i16;
+ } v;
+ value_t vt;
+
+ v.u16 = values[0];
+
+ DEBUG ("Modbus plugin: mb_read_data: "
+ "Returned int16 value is %"PRIi16, v.i16);
+
+ CAST_TO_VALUE_T (ds, vt, v.i16);
+ mb_submit (host, slave, data, vt);
+ }