From fcf1d12f7d58008d6d52ddb2447931e9240fb5fb Mon Sep 17 00:00:00 2001 From: Jan Gosmann Date: Sun, 12 Feb 2023 18:52:35 +0100 Subject: [PATCH] Compile against newer BSEC library --- CHANGELOG.md | 10 +++++++++- Cargo.toml | 2 +- src/lib.rs | 7 ++----- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71c109b..e211dbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.5.0] - 2023-02-12 + +### Changed + +* Change implementation to compile against BSEC 1.4.9.2 (instead of 1.4.8.0). + + ## [0.4.1] - 2023-02-12 ### Fixed @@ -63,7 +70,8 @@ Try to get documentation to build on docs.rs. Initial release. -[Unreleased]: https://github.com/jgosmann/bsec/compare/v0.4.1...HEAD +[Unreleased]: https://github.com/jgosmann/bsec/compare/v0.5.0...HEAD +[0.5.0]: https://github.com/jgosmann/bsec/compare/v0.4.1...v0.5.0 [0.4.1]: https://github.com/jgosmann/bsec/compare/v0.4.0...v0.4.1 [0.4.0]: https://github.com/jgosmann/bsec/compare/v0.3.1...v0.4.0 [0.3.1]: https://github.com/jgosmann/bsec/compare/v0.3.0...v0.3.1 diff --git a/Cargo.toml b/Cargo.toml index 425b764..60749ac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" name = "bsec" readme = "README.md" repository = "https://github.com/jgosmann/bsec" -version = "0.4.1" +version = "0.5.0+1.4.9.2" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/lib.rs b/src/lib.rs index 7a40518..138b8e9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -151,7 +151,7 @@ //! # let signals: std::collections::HashMap = //! # outputs.iter().map(|s| (s.sensor, s)).collect(); //! # assert!( -//! # (signals.get(&bsec::OutputKind::Iaq).unwrap().signal - 25.).abs() +//! # (signals.get(&bsec::OutputKind::Iaq).unwrap().signal - 50.).abs() //! # < f64::EPSILON //! # ); //! # return Ok(()) @@ -634,7 +634,7 @@ impl From for f64 { match sample_rate { Disabled => BSEC_SAMPLE_RATE_DISABLED, Ulp => BSEC_SAMPLE_RATE_ULP, - Continuous => BSEC_SAMPLE_RATE_CONTINUOUS, + Continuous => BSEC_SAMPLE_RATE_CONT, Lp => BSEC_SAMPLE_RATE_LP, UlpMeasurementOnDemand => BSEC_SAMPLE_RATE_ULP_MEASUREMENT_ON_DEMAND, } @@ -722,7 +722,6 @@ pub enum OutputKind { RunInStatus = 0x0200, SensorHeatCompensatedTemperature = 0x0400, SensorHeatCompensatedHumidity = 0x0800, - DebugCompensatedGas = 0x1000, GasPercentage = 0x2000, } @@ -747,7 +746,6 @@ impl From for bsec_virtual_sensor_t { SensorHeatCompensatedHumidity => { bsec_virtual_sensor_t_BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_HUMIDITY } - DebugCompensatedGas => bsec_virtual_sensor_t_BSEC_OUTPUT_COMPENSATED_GAS, GasPercentage => bsec_virtual_sensor_t_BSEC_OUTPUT_GAS_PERCENTAGE, } } @@ -776,7 +774,6 @@ impl TryFrom for OutputKind { bsec_virtual_sensor_t_BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_HUMIDITY => { Ok(SensorHeatCompensatedHumidity) } - bsec_virtual_sensor_t_BSEC_OUTPUT_COMPENSATED_GAS => Ok(DebugCompensatedGas), bsec_virtual_sensor_t_BSEC_OUTPUT_GAS_PERCENTAGE => Ok(GasPercentage), _ => Err(ConversionError::InvalidVirtualSensorId(virtual_sensor)), }