nanoFramework.IoT.Device
nanoFramework.IoT.Device copied to clipboard
[bmxx80] Improvements in units processing
Description
- The TryRead...Core return values were ignored for Bmp280, Bme280, and Bme680 sensors so ...IsValid properties were added to each of the sensor ReadResult classes (bmp280ReadResult.cs, bme280ReadResult.cs & bme680ReadResult.cs). These properties store whether the last TryReadTemperatureCore, TryReadPressureCore, TryReadHumdityCore and TryReadGasResistance core was successful.
- The signatures of the Bmp280ReadResult, Bme280ReadResult & Bme680ReadResult constructors modified adding ...IsValid parameters.
- The bmp280, bme280, & bme680 examples modified to use ...IsValid properties
Motivation and Context
Every so often BME680 sample GasResistance & Pressure value access would throw an exception, The values in the UnitsNet resistance and pressure were "invalid". I think this could also occur for Temperature and Humidity but was unable to repro.
- Fixes nanoFramework/Home#1157
How Has This Been Tested?
Purchased bmp280 & bme280 breakout boards (already had bme680) and could not repro issue after fix.
Screenshots
Types of changes
- [ ] Improvement (non-breaking change that improves a feature, code or algorithm)
- [x] Bug fix (non-breaking change which fixes an issue with code or algorithm)
- [ ] New feature (non-breaking change which adds functionality to code)
- [x] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Config and build (change in the configuration and build system, has no impact on code or features)
- [ ] Dependencies (update dependencies and changes associated, has no impact on code or features)
- [ ] Unit Tests (add new Unit Test(s) or improved existing one(s), has no impact on code or features)
- [ ] Documentation (changes or updates in the documentation, has no impact on code or features)
Checklist:
- [x] My code follows the code style of this project (only if there are changes in source code).
- [x] My changes require an update to the documentation (there are changes that require the docs website to be updated).
- [ ] I have updated the documentation accordingly (the changes require an update on the docs in this repo).
- [x] I have read the CONTRIBUTING document.
- [x] I have tested everything locally and all new and existing tests passed (only if there are changes in source code).
- [ ] I have added new tests to cover my changes.
@KiwiBryn I've fixed the checklist for you. FYI, the correct format is [x], no spaces inside brackets.
@KiwiBryn can you please address the merge conflicts GitHub is complaining about?
đź”” @KiwiBryn can you please address the merge confilcts please?
đź”” @KiwiBryn can you please address the merge confilcts please?
@josesimoes back to this next couple of days. Too much work on
@KiwiBryn the build is failing because of Stylecop rules. Can you please address those? It's code style so nothing major.
@Ellerbach I struggled with that as well…
The IoT/Devices implementation of BMXX80 relies on “nullable” which negatively impacted the initial port to nf.
Had to make some trade-offs may have got them wrong