Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return individual trimming parameters. #99

Closed
wants to merge 3 commits into from

Conversation

Bolukan
Copy link

@Bolukan Bolukan commented Nov 5, 2018

Related issue # and issue behavior

Issue #98: I would like to fingerprint each BME280 using the hash of the individual trimming parameters. I need a function that returns a copy of uint8_t m_dig[32].

Description of changes/fixes

The receiving array has to be supplied by reference. The function returns the reference to this array too (so not void, see below an example).

@mention a person to review

@finitespace, please comment.

Alternative was to return a struct. The advantage would be the parameters (dig_T1 - dig_T3, dig_P1 - dig_P9 and dig_H1 - dig_H6) could be added. But I don't need them now, so I prefer keeping it simple.

Steps to test

uint8_t parameters[32];
CRC32 crc;
uint32_t checksum = CRC32::calculate(bme.compensationParameters(parameters), 32);

Serial.printf("SensorID: 0x%08X\nHash(CRC32) of ", checksum);  
for (int i=0; i<32; i++) Serial.printf("%02X ", parameters[i]);  
Serial.print("\n");

Any outstanding TODOs or known issues

Adding an example (WIP)

@Bolukan Bolukan closed this Dec 27, 2019
@Bolukan
Copy link
Author

Bolukan commented Dec 27, 2019

Better to implement the unique BME Id

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant