Hi, I'd like confirmation of a probable bug in the BSEC_integration.c file, in the bsec_iot_init function. It reads: return_values_init bsec_iot_init(uint8_t deviceAddr, float sample_rate, float temperature_offset, bme680_com_fptr_t bus_write, bme680_com_fptr_t bus_read, sleep_fct sleep, state_load_fct state_load, config_load_fct config_load)
{
return_values_init ret = {BME680_OK, BSEC_OK};
bsec_library_return_t bsec_status = BSEC_OK;
uint8_t bsec_state[BSEC_MAX_PROPERTY_BLOB_SIZE] = {0}; // <--- BUG
uint8_t bsec_config[BSEC_MAX_PROPERTY_BLOB_SIZE] = {0};
uint8_t work_buffer[BSEC_MAX_PROPERTY_BLOB_SIZE] = {0}; // <--- BUG
int bsec_state_len, bsec_config_len; and I'm pretty sure it should read: return_values_init bsec_iot_init(uint8_t deviceAddr, float sample_rate, float temperature_offset, bme680_com_fptr_t bus_write, bme680_com_fptr_t bus_read, sleep_fct sleep, state_load_fct state_load, config_load_fct config_load)
{
return_values_init ret = {BME680_OK, BSEC_OK};
bsec_library_return_t bsec_status = BSEC_OK;
uint8_t bsec_state[BSEC_MAX_STATE_BLOB_SIZE] = {0}; // <--- BUG fixed
uint8_t bsec_config[BSEC_MAX_PROPERTY_BLOB_SIZE] = {0};
uint8_t work_buffer[BSEC_MAX_WORKBUFFER_SIZE] = {0}; // <--- BUG fixed
int bsec_state_len, bsec_config_len; Please let me know if this is indeed a bug. My app was crashing before the bug fix and is working now after the above fix. It was crashing because bsec_iot_init was calling state_load with the wrong buffer size and the subsequent call to bsec_set_state was failing. If this is confirmed to be a bug, how is it possible that no one else has discovered and reported this problem in the past two years? Thank you, Kevin
... View more