Repository navigation
DEV-1108: decide the Shimmer3R pressure sensor as the Java driver does - #26
Merged
Merged
Conversation
Three differences from the Java driver (ShimmerBluetooth and CalibDetailsBmp390) that the BMP581 support left in: - 0xA7 is not sent to LogAndStream_Shimmer3R v1.01.006 when the SR-number rule says BMP581: that version NACKs it, and the SR rule decides instead, as readPressureCalibrationCoefficients() in the Java driver does. The NACK handling from DEV-982 already stops the hang; this stops asking. - A Shimmer3R BMP390 without coefficients reports NaN for calibrated pressure and temperature (Java DEV-1125). It reported about 0 degC and 30 kPa, the clamp of all-zero coefficients, before any 0xA6 reply, after an SR-rule fallback to the BMP390, or from an all-0x00/0xFF block, which is no longer kept as coefficients. Raw values are unchanged. - A Shimmer3R's 0xA6 naming a BMP180 or BMP280 is refused, so the SR rule decides, as in the Java driver. The rule lives in PressureTempSensor, where XCTest can reach it; connect() only calls it. XCTests: the skip rule's version cases, the NaN cases (no reply, SR fallback, all-0x00, all-0xFF) against real coefficients, and the refused IDs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
harithjamadi
approved these changes
Nov 4, 2026
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.
Follow-up to #20 (DEV-1108). It makes three small changes so the Swift API decides a Shimmer3R's pressure sensor the way the Java driver does.
Changes
No 0xA7 to v1.01.006 on a BMP581. When the SR-number rule says BMP581 and the firmware is LogAndStream_Shimmer3R v1.01.006,
connect()no longer sends 0xA7. That version NACKs it, so the SR rule decides instead, as the Java driver'sreadPressureCalibrationCoefficients()does. Since DEV-982: handle NACK from a Shimmer3 instead of leaving the caller suspended #18 merged, a NACK already resumes the caller, so this stops a request that is known to be refused. It isn't what fixes the hang.NaN for a BMP390 without coefficients. On a Shimmer3R, calibrated pressure and temperature are now NaN when there are no coefficients. Java does the same (DEV-1125). Until now they came out as about 0 °C and 30 kPa (the clamp of all-zero coefficients) in three cases:
Raw values are unchanged.
BMP180/BMP280 IDs refused on a Shimmer3R. A Shimmer3R whose 0xA6 reply names a BMP180 or BMP280 is refused, and the SR rule decides, as in Java.
The rule is
PressureTempSensor.readsPressureCalibrationCoefficients, so XCTest can reach it.Shimmer3Protocol.connect()only calls it.Testing
xcodebuild test -scheme ShimmerBluetoothTests, run locally on macOS (Xcode 26.6): 60 tests passed, 0 failed.testReadsPressureCalibrationCoefficientsandtestBMP390WithoutCoefficients.testPressureCalibrationResponsenow covers the refused IDs.connect()is untested. XCTest can't constructShimmer3Protocol(see AGENTS.md), and nothing has run on hardware.Hardware check
01 03, the log says "Pressure sensor: BMP581", and pressure is about 100 kPa.Other APIs
🤖 Generated with Claude Code