Add E-Trailer Gaslevel support to Mopeka Std Check (#5397)

* Add E-Trailer Gaslevel support to Mopeka Std Check

Signed-off-by: Philipp Helo Rehs <Philipp.Rehs@hhu.de>

* fix format

---------

Signed-off-by: Philipp Helo Rehs <Philipp.Rehs@hhu.de>
Co-authored-by: Philipp Helo Rehs <Philipp.Rehs@hhu.de>
This commit is contained in:
Philipp Helo Rehs 2023-09-17 07:30:52 +02:00 committed by GitHub
parent 164631fcec
commit 11f6e555f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -71,7 +71,8 @@ bool MopekaStdCheck::parse_device(const esp32_ble_tracker::ESPBTDevice &device)
const auto *mopeka_data = (const mopeka_std_package *) manu_data.data.data(); const auto *mopeka_data = (const mopeka_std_package *) manu_data.data.data();
const u_int8_t hardware_id = mopeka_data->data_1 & 0xCF; const u_int8_t hardware_id = mopeka_data->data_1 & 0xCF;
if (static_cast<SensorType>(hardware_id) != STANDARD && static_cast<SensorType>(hardware_id) != XL) { if (static_cast<SensorType>(hardware_id) != STANDARD && static_cast<SensorType>(hardware_id) != XL &&
static_cast<SensorType>(hardware_id) != ETRAILER) {
ESP_LOGE(TAG, "[%s] Unsupported Sensor Type (0x%X)", device.address_str().c_str(), hardware_id); ESP_LOGE(TAG, "[%s] Unsupported Sensor Type (0x%X)", device.address_str().c_str(), hardware_id);
return false; return false;
} }

View file

@ -14,6 +14,7 @@ namespace mopeka_std_check {
enum SensorType { enum SensorType {
STANDARD = 0x02, STANDARD = 0x02,
XL = 0x03, XL = 0x03,
ETRAILER = 0x46,
}; };
// 4 values in one struct so it aligns to 8 byte. One `mopeka_std_values` is 40 bit long. // 4 values in one struct so it aligns to 8 byte. One `mopeka_std_values` is 40 bit long.