fix modbus sending FP32_R values (#4882)

This commit is contained in:
Samuel Sieb 2023-05-23 15:00:33 -07:00 committed by GitHub
parent baa08160bb
commit 4141100b1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -506,12 +506,12 @@ void number_to_payload(std::vector<uint16_t> &data, int64_t value, SensorValueTy
case SensorValueType::U_DWORD:
case SensorValueType::S_DWORD:
case SensorValueType::FP32:
case SensorValueType::FP32_R:
data.push_back((value & 0xFFFF0000) >> 16);
data.push_back(value & 0xFFFF);
break;
case SensorValueType::U_DWORD_R:
case SensorValueType::S_DWORD_R:
case SensorValueType::FP32_R:
data.push_back(value & 0xFFFF);
data.push_back((value & 0xFFFF0000) >> 16);
break;