Repository navigation
DEV-1110: read the BMP581 in-band sensor ID and add SR38-4-2 to the SR rule - #311
Merged
Merged
Conversation
The 0xA6 PRESSURE_CALIBRATION_COEFFICIENTS_RESPONSE is [0xA6][len = 1+n][sensorId][n coefficient bytes], but the driver read a fixed length chosen from the sensor it had assumed. It now reads the length byte, then the payload, validates the length against the sensor ID (BMP180 22, BMP280 24, BMP390 21, BMP581 0) and rejects a mismatch instead of applying it. The stream stays in step either way. On a Shimmer3R the sensor ID overrides the SR-number rule in both directions: ShimmerObject.mPressureSensorIdInBand is consulted first by isSupportedBmp581(), and if the sensor class in use is the wrong one the sensor classes are rebuilt and the config bytes re-parsed into the new class. The ID is cleared when the expansion board details change. The BMP390 path passes the same 21 coefficient bytes as before. 0xA7 is now sent to Shimmer3R boards the SR rule marks as BMP581 when the firmware is v1.01.007+, which answers [A6][01][03]. It is still skipped on v1.01.006, which NACKs it on a BMP581: master has no NACK handling (DEV-982 is unmerged), so an unanswered command times out and drops the connection, and the SR-rule result stands there. The SR rule gains SR38 (Proto3 Deluxe) >= 4.2 and is now written as the firmware's ShimBrd_isBmp581PresentPerSrNumber(). API_00020 copies the firmware's test_bmp581_gate() cases; API_00021 (ShimmerDriverPC, as it needs ShimmerPC) covers 0xA6 parsing, the override and the 0xA7 decision. Neither is added to the API_00005 suite, as with DEV-1102. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira: DEV-1110. This is a follow-up to DEV-852 and is independent of #310 (DEV-1102): it touches none of #310's lines, and
git merge-treeagainst it is clean. Part of the BMP581 host rollout, with Shimmer-C-API#208, SwiftAPI#20, shimmer-web-sdk#168 and the pyshimmer upstream PR.Problem
[A6][01][03](sensor ID 3), seeshimmer_bt_uart.c:2064-2099.hal_pressure.c), so a board whose fitted chip disagrees with its SR number was decoded wrongly.ShimBrd_isBmp581PresentPerSrNumber()includes.Change
[sensorId][coefficients], and validates the count against the ID (22/24/21/0). A mismatch is logged and rejected, and the stream stays in step.setPressureSensorIdInBand(), which overrides the SR rule in either direction.isSupportedBmp581(svo, ebd)is still the SR rule on its own, used for SD logs, whose header carries no sensor ID.SensorBMP581. The comment that the firmware NACKs 0xA7 is corrected.Tests
API_00020_Bmp581SrRuleTest(ShimmerDriver):test_bmp581_gatecase, including SR48-8.0/8.1 = BMP390 and SR38-4-2 = BMP581;API_00021_Bmp581InBandSensorIdTest(ShimmerDriverPC). It drives the real handler from a byte queue and covers:API_00005suite, as with DEV-1102.ShimmerDriver ./gradlew test: 113 tests, 0 failures.ShimmerDriverPC ./gradlew build: 142 tests, 0 failures, including the existing Shimmer3R connect test.Not verified / known
ByteCommunicationSimulatorS3Ranswers 0xA7 with a Shimmer3 BMP280 payload. That is now rejected on a 3R, where master used to apply it as BMP390 coefficients. The simulator is unchanged.setUseInfoMemConfigMethod(false), ranges read individually before 0xA7 are not re-applied after a sensor switch.After merge: bump ASM_PC's submodule pin, along with #310.
🤖 Generated with Claude Code