Skip to content

fix: read chip ID with single byte read from 0xD0#15

Merged
guillaumedelre merged 1 commit into
developfrom
fix/chip-id-read
May 14, 2026
Merged

fix: read chip ID with single byte read from 0xD0#15
guillaumedelre merged 1 commit into
developfrom
fix/chip-id-read

Conversation

@guillaumedelre
Copy link
Copy Markdown
Owner

Summary

  • Replace read_i2c_block_data(addr, 0xD0, 2) with read_byte_data(addr, 0xD0) in read_id()
  • Register 0xD1 is undocumented in the official Bosch SensorAPI — the second byte was never meaningful
  • Return (chip_id, 0) to keep the existing tuple[int, int] API intact without breaking callers
  • Update test_read_id_uses_single_byte_read: asserts read_byte_data is called with 0xD0

Test plan

  • 21 tests pass: docker compose run --rm test

The official Bosch SensorAPI reads only 1 byte from register 0xD0.
Register 0xD1 is undocumented — reading it was a leftover from the
original Matt Hawkins driver. Return (chip_id, 0) to preserve the
existing tuple API without breaking callers.
Update tests to assert read_byte_data is used and called with 0xD0.

Co-authored-by: agilicode <agilicode@gmail.com>
@guillaumedelre guillaumedelre merged commit 700fff7 into develop May 14, 2026
3 checks passed
@guillaumedelre guillaumedelre deleted the fix/chip-id-read branch May 14, 2026 09:55
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