From 76aa26863f7ffb02553e02eccc17e7d8a84fc55b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 29 Oct 2026 07:53:07 +0000 Subject: [PATCH 1/2] Build against Shimmer Java API 0.11.12_beta by default Moves the default driver version in ShimmerAndroidInstrumentDriver/build.gradle from 0.11.11_beta to 0.11.12_beta. Opened by ShimmerResearch/Shimmer-Java-Android-API's Release workflow for API_v0.11.12_beta (26ae4e74c2064453db956e209217fdcf2d21aec3). --- ShimmerAndroidInstrumentDriver/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShimmerAndroidInstrumentDriver/build.gradle b/ShimmerAndroidInstrumentDriver/build.gradle index 92adb2a..f1c4ab8 100644 --- a/ShimmerAndroidInstrumentDriver/build.gradle +++ b/ShimmerAndroidInstrumentDriver/build.gradle @@ -26,7 +26,7 @@ apply plugin: 'maven-publish' // The shimmerdriver / shimmerbluetoothmanager version (Shimmer-Java-Android-API) that the library and // every example build against. The default is what master builds with; the Release Android API // workflow passes -PdriverVersion, by default the newest Java API release. -def shimmerDriverVersion = findProperty('driverVersion') ?: '0.11.11_beta' +def shimmerDriverVersion = findProperty('driverVersion') ?: '0.11.12_beta' allprojects { repositories { From e150536afa111efd9d9391ca9f0e8bd15b4812b7 Mon Sep 17 00:00:00 2001 From: JongChern Date: Thu, 29 Oct 2026 18:06:53 +0800 Subject: [PATCH 2/2] DEV-1337: adapt AAPI_00002, 00003 and 00005 to driver 0.11.12_beta Driver 0.11.12_beta no longer writes the clock to a streaming Shimmer3R (Shimmer-Java-Android-API#339), so startSDLogging() on one queues only START_LOGGING_ONLY_COMMAND. The three tests expected SET_RWC_COMMAND first. As #339 did for the driver's own tests, they now put START_LOGGING_ONLY in flight. Where a test needs a command queued behind it, they use readDirectoryName(): while streaming, readBattery() here writes straight to the socket rather than queueing. AGENTS.md records the case as done. Co-Authored-By: Claude Opus 5.5 --- AGENTS.md | 9 ++++-- .../AAPI_00002_StreamingBareAckCrcTest.java | 19 +++++-------- ...I_00003_StreamingInstreamResponseTest.java | 28 +++++++++++-------- ...AAPI_00005_StreamingAckAfterPauseTest.java | 9 +++--- 4 files changed, 34 insertions(+), 31 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index b35035b..232d52b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -122,9 +122,12 @@ That runs both the debug and release variants. CI runs the debug variant (`testD Some tests pin down what the driver queues, not only what `Shimmer.java` does, so a driver pin bump can fail them with nothing wrong here: adapt them to the driver's new behaviour in the bump PR. The -first case is DEV-1337 (Shimmer-Java-Android-API#339), which stops the driver writing the clock to -a streaming Shimmer3R, while AAPI_00002, 00003 and 00005 expect `startSDLogging()` on one to queue -`SET_RWC_COMMAND`. #339 adapts the driver's own tests the same way. +first case was driver 0.11.12_beta and DEV-1337 (Shimmer-Java-Android-API#339): the driver no longer +writes the clock to a streaming Shimmer3R, so `startSDLogging()` on one queues only +`START_LOGGING_ONLY_COMMAND`. The 0.11.12_beta bump adapted AAPI_00002, 00003 and 00005 to that, as +#339 did the driver's own tests. Where a test needs a command queued behind the one in flight, it +uses `readDirectoryName()`: while streaming, `readBattery()` here writes straight to the socket +rather than queueing. ## CI diff --git a/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/src/test/java/com/shimmerresearch/bluetooth/AAPI_00002_StreamingBareAckCrcTest.java b/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/src/test/java/com/shimmerresearch/bluetooth/AAPI_00002_StreamingBareAckCrcTest.java index b990b8d..6bf044c 100644 --- a/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/src/test/java/com/shimmerresearch/bluetooth/AAPI_00002_StreamingBareAckCrcTest.java +++ b/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/src/test/java/com/shimmerresearch/bluetooth/AAPI_00002_StreamingBareAckCrcTest.java @@ -253,30 +253,25 @@ private static void assertNoResync(QueueShimmer device) { } /** - * startSDLogging() while streaming sends SET_RWC_COMMAND and then - * START_LOGGING_ONLY_COMMAND, and the firmware answers each with a bare ACK + * startSDLogging() while a Shimmer3R streams sends START_LOGGING_ONLY_COMMAND, + * with no clock write before it (DEV-1337), and the firmware answers with a + * bare ACK */ private void startSdLoggingWhileStreaming(BT_CRC_MODE crcMode, int readSize) { QueueShimmer device = streamingShimmer3r(crcMode); device.startSDLogging(); - - sendNextInstruction(device); - assertEquals(ShimmerObject.SET_RWC_COMMAND, device.mCurrentCommand); - receive(device, readSize, dataPacket(payload(1), crcMode), bareAck(crcMode), - dataPacket(payload(2), crcMode), dataPacket(payload(3), crcMode)); - assertAckProcessed(device); - assertEquals("START_LOGGING_ONLY_COMMAND is still queued", 1, device.getListofInstructions().size()); + assertEquals("only START_LOGGING_ONLY_COMMAND is queued", 1, device.getListofInstructions().size()); sendNextInstruction(device); assertEquals(ShimmerObject.START_LOGGING_ONLY_COMMAND, device.mCurrentCommand); - receive(device, readSize, dataPacket(payload(4), crcMode), bareAck(crcMode), - dataPacket(payload(5), crcMode), new byte[] {ShimmerObject.DATA_PACKET}); + receive(device, readSize, dataPacket(payload(1), crcMode), bareAck(crcMode), + dataPacket(payload(2), crcMode), dataPacket(payload(3), crcMode), new byte[] {ShimmerObject.DATA_PACKET}); assertAckProcessed(device); assertTrue(device.getListofInstructions().isEmpty()); assertTrue(device.isSDLogging()); assertEquals(BT_STATE.STREAMING_AND_SDLOGGING, device.getBluetoothRadioState()); - assertParsed(device, payload(1), payload(2), payload(3), payload(4), payload(5)); + assertParsed(device, payload(1), payload(2), payload(3)); assertBuffered(device, ShimmerObject.DATA_PACKET); assertNoResync(device); } diff --git a/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/src/test/java/com/shimmerresearch/bluetooth/AAPI_00003_StreamingInstreamResponseTest.java b/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/src/test/java/com/shimmerresearch/bluetooth/AAPI_00003_StreamingInstreamResponseTest.java index cce9a49..50b4ead 100644 --- a/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/src/test/java/com/shimmerresearch/bluetooth/AAPI_00003_StreamingInstreamResponseTest.java +++ b/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/src/test/java/com/shimmerresearch/bluetooth/AAPI_00003_StreamingInstreamResponseTest.java @@ -357,13 +357,13 @@ public void replyToTheQueuedCommandInFlightCompletesItOnce() throws Exception { receive(device, readSize, dataPacket(payload(1), crcMode), statusPush(STATUS_STREAMING, crcMode), dataPacket(payload(2), crcMode)); assertAwaitingReply(device, ShimmerObject.GET_DIR_COMMAND); - assertQueued(device, ShimmerObject.GET_DIR_COMMAND, ShimmerObject.SET_RWC_COMMAND, ShimmerObject.START_LOGGING_ONLY_COMMAND); + assertQueued(device, ShimmerObject.GET_DIR_COMMAND, ShimmerObject.START_LOGGING_ONLY_COMMAND); receive(device, readSize, dataPacket(payload(3), crcMode), dirReply(crcMode), dataPacket(payload(4), crcMode), new byte[] {ShimmerObject.DATA_PACKET}); assertEquals(DIRECTORY_NAME, device.getDirectoryName()); assertAnswered(device); - assertQueued(device, ShimmerObject.SET_RWC_COMMAND, ShimmerObject.START_LOGGING_ONLY_COMMAND); + assertQueued(device, ShimmerObject.START_LOGGING_ONLY_COMMAND); assertParsed(device, payload(1), payload(2), payload(3), payload(4)); assertBuffered(device, ShimmerObject.DATA_PACKET); @@ -372,36 +372,40 @@ public void replyToTheQueuedCommandInFlightCompletesItOnce() throws Exception { } /** - * startSDLogging() while streaming queues SET_RWC_COMMAND, then - * START_LOGGING_ONLY_COMMAND. In-stream responses that answer neither leave + * startSDLogging() while a Shimmer3R streams queues START_LOGGING_ONLY_COMMAND + * with no clock write before it (DEV-1337), and readDirectoryName() queues + * GET_DIR_COMMAND behind it. In-stream responses that answer neither leave * both alone: the battery timer's reading, which readBattery() wrote straight * out, while the first awaits its ACK, and a status push while the second - * waits its turn. The first used to take SET_RWC_COMMAND off the queue, so - * its ACK was processed against START_LOGGING_ONLY_COMMAND's instruction. + * waits its turn. The first used to take the SET command in flight off the + * queue, so its ACK was processed against the next instruction. */ @Test public void responsesThatAnswerNoQueuedCommandLeaveTheQueueAlone() throws Exception { forEveryCrcModeAndReadSize((crcMode, readSize) -> { QueueShimmer device = streamingShimmer3r(crcMode); device.startSDLogging(); + device.readDirectoryName(); sendNextInstruction(device); device.readBattery(); receive(device, readSize, dataPacket(payload(1), crcMode), vbattReply(crcMode), dataPacket(payload(2), crcMode)); assertEquals(VBATT_ADC, device.getBattStatusDetails().getBattAdcValue(), 0); - assertAwaitingReply(device, ShimmerObject.SET_RWC_COMMAND); - assertQueued(device, ShimmerObject.SET_RWC_COMMAND, ShimmerObject.START_LOGGING_ONLY_COMMAND); + assertAwaitingReply(device, ShimmerObject.START_LOGGING_ONLY_COMMAND); + assertQueued(device, ShimmerObject.START_LOGGING_ONLY_COMMAND, ShimmerObject.GET_DIR_COMMAND); receive(device, readSize, dataPacket(payload(3), crcMode), bareAck(crcMode), dataPacket(payload(4), crcMode)); assertAnswered(device); - assertQueued(device, ShimmerObject.START_LOGGING_ONLY_COMMAND); + assertQueued(device, ShimmerObject.GET_DIR_COMMAND); + assertTrue(device.isSDLogging()); - receive(device, readSize, dataPacket(payload(5), crcMode), statusPush(STATUS_STREAMING, crcMode), dataPacket(payload(6), crcMode)); - assertQueued(device, ShimmerObject.START_LOGGING_ONLY_COMMAND); + receive(device, readSize, dataPacket(payload(5), crcMode), statusPush(STATUS_STREAMING_AND_LOGGING, crcMode), dataPacket(payload(6), crcMode)); + assertQueued(device, ShimmerObject.GET_DIR_COMMAND); sendNextInstruction(device); - receive(device, readSize, dataPacket(payload(7), crcMode), bareAck(crcMode), + receive(device, readSize, dataPacket(payload(7), crcMode), dirReply(crcMode), dataPacket(payload(8), crcMode), new byte[] {ShimmerObject.DATA_PACKET}); + assertEquals(DIRECTORY_NAME, device.getDirectoryName()); assertAnswered(device); assertQueued(device); assertTrue(device.isSDLogging()); diff --git a/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/src/test/java/com/shimmerresearch/bluetooth/AAPI_00005_StreamingAckAfterPauseTest.java b/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/src/test/java/com/shimmerresearch/bluetooth/AAPI_00005_StreamingAckAfterPauseTest.java index 9dc1105..0ff2f9b 100644 --- a/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/src/test/java/com/shimmerresearch/bluetooth/AAPI_00005_StreamingAckAfterPauseTest.java +++ b/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/src/test/java/com/shimmerresearch/bluetooth/AAPI_00005_StreamingAckAfterPauseTest.java @@ -385,15 +385,16 @@ public void bareAckInThePause() throws Exception { forEachCrcModeAndReadSize(CRC_ON, (crcMode, readSize) -> { QueueShimmer device = streamingShimmer3r(crcMode); device.stopSDLogging(); - device.startSDLogging(); - assertQueued(device, ShimmerObject.STOP_LOGGING_ONLY_COMMAND, ShimmerObject.SET_RWC_COMMAND, ShimmerObject.START_LOGGING_ONLY_COMMAND); + device.startSDLogging(); // START_LOGGING_ONLY_COMMAND: no clock write to a streaming Shimmer3R (DEV-1337) + device.readDirectoryName(); + assertQueued(device, ShimmerObject.STOP_LOGGING_ONLY_COMMAND, ShimmerObject.START_LOGGING_ONLY_COMMAND, ShimmerObject.GET_DIR_COMMAND); stopLoggingAndReceiveItsAck(device, crcMode, readSize); sendNextInstruction(device); - assertEquals(ShimmerObject.SET_RWC_COMMAND, device.mCurrentCommand); + assertEquals(ShimmerObject.START_LOGGING_ONLY_COMMAND, device.mCurrentCommand); receive(device, readSize, bareAck(crcMode), dataPacket(payload(2), crcMode), new byte[] {ShimmerObject.DATA_PACKET}); assertAnswered(device); - assertQueued(device, ShimmerObject.START_LOGGING_ONLY_COMMAND); + assertQueued(device, ShimmerObject.GET_DIR_COMMAND); assertParsed(device, payload(1), payload(2)); assertBuffered(device, ShimmerObject.DATA_PACKET);