arduino-libraries / Arduino_BMI270_BMM150

GNU Lesser General Public License v2.1
18 stars 12 forks source link

Fix: remove function definition for not implemented function "getTemperature". #28

Closed aentinger closed 1 year ago

aentinger commented 1 year ago

This fixes #27.

Hi @simonmicro, you're right, the function is not implemented ...

At first I though this would be quick to fix, but the more I dived into the existing library the more roadblocks I encountered.

The main issue is that this library is built around a sensor interface library provided by Bosch (BMI270-Sensor-API). And while the sensor provides a temperature sensor and it would be relatively easy to bypass the Bosch interface library to directly read it out doing so could create problems down the road (since then there would be direct chip access bypassing the Bosch interface library). Extending the Bosch interface library would have been the option, but boy is that one tailored for a specific use case. Given that I have neither the time nor the mandate to do this I'm going with the easiest option - removing the misleading prototype so that future users do not fall into the same trap.

simonmicro commented 1 year ago

Heyho @aentinger ,

thanks for your time looking into it - but do not be afraid of the Bosch C-Library!

but boy is that one tailored for a specific use case

Boi - you are very right! I have to admit, starting from scratch is very unintuitive, but... Well... I did it myself, after this library failed to provide me the needed features (specifically raw register access) :rofl:

https://github.com/Open-Smartwatch/open-smartwatch-os/blob/feature/flow3r_badge/src/devices/bmi270.cpp

...in case you are wondering how access the correct register to retrieve the temperature, there you go:

https://github.com/Open-Smartwatch/open-smartwatch-os/blob/8a0e48a3cfc46f04479f64957ed3232aa1904700/src/devices/bmi270.cpp#L154

After much bit-banging I also figured that out, sadly the Bosch library does not offer any easy way (or defines) to directly access that. By the way, much thanks for your work - it was a really great start to build my own implementation of it! Thank you very much! :heart:

Hope this helps :wink:

aentinger commented 1 year ago

Hah, I even looked at your fork at https://github.com/Open-Smartwatch/BMI270-Sensor-API 😉 .

Thank you for pointing out your solution, I'll create a feature request with Bosch, so that they may find it in their power to extend the API.

aentinger commented 1 year ago

Or maybe there is a way ... https://github.com/boschsensortec/BMI270-Sensor-API/blob/master/bmi270_examples/temperature/temperature.c 🤔 ? Reopening - need to examine this.