I'm using the bme680 with the bsec library and the bsec iot example code as my starting point. I notice that the sample code does not check the status for the call to bsec_sensor_control(). Under normal circumstances this always returns 0 but what if it doesn't? If I force an error with an invalid timestamp I notice it never recovers. What about bsec_do_steps()? The status code from this call is just passed to a user provided function.
There was BSEC iot example code in another ticket, could you refer it?
Not really relevant at all. The link was a case of someone setting things up incorrectly. My point was that the libraries return error codes but none of the example code actually handles the error codes. Are the codes only for cases where someone has made a coding mistake? What if someone has a higher level process that starves the bme680 process for long enough that it gets a BSEC_W_SC_CALL_TIMING_VIOLATION when it finally runs? How do I recover? My goal is to have this run for years and I don't want to reset everything when their is an error.
On my side, it worked well after I migrating BSEC to MCU. bsec_sensor_control() always returned 0.
You forced an error with an invalid timestamp, this is unreasonable in itself. The algorithm needs to be got correct input parameters, and it must ensure the parameters are correct.