From 30a20bd194bc10c71edfb7af66c7e7bface774e8 Mon Sep 17 00:00:00 2001 From: JongChern Date: Sun, 25 Oct 2026 12:46:54 +0800 Subject: [PATCH 1/2] DEV-1337: don't write the clock to a streaming Shimmer3R On a Shimmer3R the counter that stamps each streamed packet is the real-world clock, so a clock write (SET_RWC) while it streams steps that counter. Packets come out off the sample grid and sometimes behind the one before, and a step back beyond the timestamp unwrap's reorder window reads as a counter wrap, stamping the rest of the session 512 s late (DEV-1245, firmware, still in v1.1.22). startSDLogging() wrote the clock before every logging start, so starting logging mid-stream triggered it every time. The IO thread now drops a clock write unsent while a Shimmer3R streams, whatever queued it: startSDLogging(), an app's writeRealTimeClock(), or the status rule. Checking at send time also catches a write queued just before streaming started. The connect sequence still writes the clock, and the status rule writes it at the next reply while the unit isn't streaming if it is ever unset. A Shimmer3 keeps its timestamps in order across a clock write, so it still gets it mid-stream. The C# API already writes the clock only at connect, and pyshimmer and the web SDK don't write it when logging starts. API_00035 runs the IO thread over an in-memory radio. Without the fix, a streaming Shimmer3R is sent SET_RWC by startSDLogging() and by writeRealTimeClock(); with it, neither is, while an idle Shimmer3R, a streaming Shimmer3 and the connect-time write are unchanged. On a Shimmer3R over BLE (Android HIL midStreamSet and inStream, two runs each), driver 0.11.11 failed 3 of 4 with backward timestamps and 512 s jumps; this build passed 4 of 4, sending the clock once at connect and dropping the 3-4 mid-stream writes per run. Co-Authored-By: Claude Opus 5.5 --- .../bluetooth/ShimmerBluetooth.java | 33 ++- ..._00035_NoClockWriteWhileStreamingTest.java | 218 ++++++++++++++++++ tools/hil/README.md | 2 +- 3 files changed, 250 insertions(+), 3 deletions(-) create mode 100644 ShimmerDriverPC/src/test/java/com/shimmerresearch/bluetooth/API_00035_NoClockWriteWhileStreamingTest.java diff --git a/ShimmerDriver/src/main/java/com/shimmerresearch/bluetooth/ShimmerBluetooth.java b/ShimmerDriver/src/main/java/com/shimmerresearch/bluetooth/ShimmerBluetooth.java index 0b7b49c01..118c05ac7 100644 --- a/ShimmerDriver/src/main/java/com/shimmerresearch/bluetooth/ShimmerBluetooth.java +++ b/ShimmerDriver/src/main/java/com/shimmerresearch/bluetooth/ShimmerBluetooth.java @@ -720,6 +720,14 @@ private boolean processNextInstruction() { //checkAndRemoveFirstInstructionIfNull(); byte[] insBytes = getInstruction(); + if (insBytes!=null && insBytes[0]==SET_RWC_COMMAND && isRealTimeClockWriteBlocked()){ + // Dropped unsent: see isRealTimeClockWriteBlocked() + synchronized(mListofInstructions){ + mListofInstructions.remove(insBytes); + } + printLogDataForDebugging("SET_RWC_COMMAND not sent: the Shimmer3R is streaming (DEV-1337)"); + return true; + } if (insBytes!=null){ mCurrentCommand=insBytes[0]; setInstructionStackLock(true); @@ -3097,6 +3105,11 @@ private void initialiseStreaming(){ mSync=true; // a backup sync done every time you start streaming } + /** + * Starts SD logging, writing the PC's time to the clock first. On a Shimmer3R that is streaming + * the clock write is not sent (see isRealTimeClockWriteBlocked()), and logging starts on the clock + * the connect sequence set. + */ @Override public void startSDLogging(){ //Shouldn't be logging anyway but just incase. @@ -4213,8 +4226,10 @@ public void readRealTimeClock(){ } } - /**Gets pc time and writes the 8 byte value to shimmer device - * + /** + * Queues a write of the PC's time to the Shimmer's real-world clock; the time is read just before + * the command is sent. It is not sent to a Shimmer3R that is streaming by then (see + * isRealTimeClockWriteBlocked()): the connect sequence sets the clock instead. */ public void writeRealTimeClock(){ if(getFirmwareIdentifier()==FW_ID.LOGANDSTREAM){ @@ -4225,6 +4240,20 @@ public void writeRealTimeClock(){ } } + /** + * Whether a clock write must not be sent now. On a Shimmer3R the counter that stamps each + * streamed packet is the real-world clock, so setting the clock mid-stream steps it: packets come + * out off the sample grid and sometimes behind the one before, and a step back beyond the + * timestamp unwrap's reorder window reads as a counter wrap, stamping the rest of the session + * 512 s late (DEV-1245, firmware). So the clock is not written to a streaming Shimmer3R + * (DEV-1337). The connect sequence sets it, and if a status reply shows it unset, it is written at + * the next reply while the unit isn't streaming. A Shimmer3 keeps its timestamps in order across + * a clock write, so it is still written there. + */ + protected boolean isRealTimeClockWriteBlocked() { + return mIsStreaming && getHardwareVersion()==HW_ID.SHIMMER_3R; + } + public void readGyroRange() { writeInstruction(GET_MPU9150_GYRO_RANGE_COMMAND); } diff --git a/ShimmerDriverPC/src/test/java/com/shimmerresearch/bluetooth/API_00035_NoClockWriteWhileStreamingTest.java b/ShimmerDriverPC/src/test/java/com/shimmerresearch/bluetooth/API_00035_NoClockWriteWhileStreamingTest.java new file mode 100644 index 000000000..d42a0e64f --- /dev/null +++ b/ShimmerDriverPC/src/test/java/com/shimmerresearch/bluetooth/API_00035_NoClockWriteWhileStreamingTest.java @@ -0,0 +1,218 @@ +package com.shimmerresearch.bluetooth; + +import static org.junit.Assert.*; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.ConcurrentLinkedDeque; + +import org.junit.After; +import org.junit.Test; + +import com.shimmerresearch.driver.ShimmerObject; +import com.shimmerresearch.driverUtilities.ShimmerVerDetails.FW_ID; +import com.shimmerresearch.driverUtilities.ShimmerVerDetails.HW_ID; +import com.shimmerresearch.driverUtilities.ShimmerVerObject; +import com.shimmerresearch.pcDriver.ShimmerPC; +import com.shimmerresearch.shimmer3.communication.ByteCommunication; +import com.shimmerresearch.verisense.communication.ByteCommunicationListener; + +import jssc.SerialPortTimeoutException; + +/** + * DEV-1337: on a Shimmer3R the counter that stamps each streamed packet is the real-world clock, so + * a clock write (SET_RWC) while it streams steps that counter. Packets come out off the sample grid + * and sometimes behind the one before, and a step back beyond the timestamp unwrap's reorder window + * reads as a counter wrap, stamping the rest of the session 512 s late (DEV-1245, firmware). + * startSDLogging() wrote the clock before every logging start, so starting logging mid-stream + * triggered it every time; the Android HIL's midStreamSet and inStream failed on a Shimmer3R for it. + *

+ * The IO thread now drops a clock write unsent while a Shimmer3R streams. The connect sequence still + * writes the clock, and a Shimmer3, whose timestamps stay in order across a clock write, still gets + * it mid-stream. + *

+ * No hardware: the IOThread runs as connect() starts it, over an in-memory radio that acknowledges + * every command, and records what reaches the unit. + */ +public class API_00035_NoClockWriteWhileStreamingTest { + + private static final long WAIT_MS = 5000; + + /** Not docked, sensing or logging; RTC set */ + private static final byte STATUS_IDLE = 0x04; + + /** Sensing and SD logging; RTC set */ + private static final byte STATUS_SD_LOGGING = 0x0E; + + /** A Shimmer3R's second status byte: USB not plugged in */ + private static final byte STATUS_USB_UNPLUGGED = 0x00; + + private static class AnsweringRadio implements ByteCommunication { + final ConcurrentLinkedDeque rx = new ConcurrentLinkedDeque(); + final List written = Collections.synchronizedList(new ArrayList()); + + void queue(byte... bytes) { + for(byte b:bytes){ + rx.add(b); + } + } + + List commandsWritten() { + List commands = new ArrayList(); + synchronized(written){ + for(byte[] w:written){ + commands.add(w[0]); + } + } + return commands; + } + + @Override + public boolean writeBytes(byte[] buffer) { + written.add(buffer.clone()); + queue(ShimmerObject.ACK_COMMAND_PROCESSED); + return true; + } + + @Override + public byte[] readBytes(int byteCount, int timeout) throws SerialPortTimeoutException { + if(rx.size() sent = radio.commandsWritten(); + assertFalse("no SET_RWC sent to a streaming Shimmer3R: " + sent, sent.contains(ShimmerObject.SET_RWC_COMMAND)); + assertTrue("logging still starts: " + sent, sent.contains(ShimmerObject.START_LOGGING_ONLY_COMMAND)); + } + + /** An app's own call is held back the same way */ + @Test + public void writeRealTimeClockOnAStreamingShimmer3rSendsNothing() throws Exception { + AnsweringRadio radio = connected(HW_ID.SHIMMER_3R, true); + mDevice.writeRealTimeClock(); + waitForQueueToDrain(); + assertEquals("nothing sent", new ArrayList(), radio.commandsWritten()); + } + + @Test + public void startSdLoggingOnAnIdleShimmer3rStillWritesTheClockFirst() throws Exception { + AnsweringRadio radio = connected(HW_ID.SHIMMER_3R, false); + mDevice.startSDLogging(); + waitForQueueToDrain(); + List sent = radio.commandsWritten(); + assertEquals("SET_RWC, then START_LOGGING_ONLY: " + sent, 2, sent.size()); + assertEquals(ShimmerObject.SET_RWC_COMMAND, (byte) sent.get(0)); + assertEquals(ShimmerObject.START_LOGGING_ONLY_COMMAND, (byte) sent.get(1)); + } + + /** + * A Shimmer3 keeps its timestamps in order across a clock write, so it is unchanged. Only the + * first command is checked: while streaming the driver takes an ACK only among stream data, which + * this radio doesn't send, so the clock write's ACK timeout clears the logging start behind it. + */ + @Test + public void startSdLoggingOnAStreamingShimmer3StillWritesTheClock() throws Exception { + AnsweringRadio radio = connected(HW_ID.SHIMMER_3, true); + mDevice.startSDLogging(); + waitForQueueToDrain(); + List sent = radio.commandsWritten(); + assertFalse("something was sent", sent.isEmpty()); + assertEquals("SET_RWC sent first to a streaming Shimmer3: " + sent, ShimmerObject.SET_RWC_COMMAND, (byte) sent.get(0)); + } + + /** + * The clock is set at connect instead: the connect sequence reads the status, and while the unit + * isn't initialised or logging, that reply queues a clock write. No IOThread here: the reply is + * handed to the driver's parser as the IO thread does, and the queue is inspected. + */ + private ShimmerPC connectingShimmer3r(byte status) { + AnsweringRadio radio = new AnsweringRadio(); + mDevice = new ShimmerPC("COM99"); + mDevice.setTestRadio(radio); + mDevice.setShimmerVersionObjectAndCreateSensorMap(new ShimmerVerObject(HW_ID.SHIMMER_3R, FW_ID.LOGANDSTREAM, 1, 1, 22)); + mDevice.mCurrentCommand = ShimmerObject.GET_STATUS_COMMAND; + radio.queue(ShimmerObject.STATUS_RESPONSE, status, STATUS_USB_UNPLUGGED); + mDevice.processInstreamResponse(false); + assertTrue("the whole reply is read", radio.rx.isEmpty()); + return mDevice; + } + + private static boolean queued(ShimmerPC device, byte command) { + for(byte[] instruction:device.getListofInstructions()){ + if(instruction!=null && instruction[0]==command){ + return true; + } + } + return false; + } + + @Test + public void aConnectToAUnitNotLoggingWritesTheClock() { + ShimmerPC device = connectingShimmer3r(STATUS_IDLE); + assertTrue("SET_RWC queued during connect", queued(device, ShimmerObject.SET_RWC_COMMAND)); + } + + /** A logging unit's clock is left alone, so its SD log isn't stepped */ + @Test + public void aConnectToALoggingUnitLeavesTheClock() { + ShimmerPC device = connectingShimmer3r(STATUS_SD_LOGGING); + assertFalse("no SET_RWC queued for a logging unit", queued(device, ShimmerObject.SET_RWC_COMMAND)); + } +} diff --git a/tools/hil/README.md b/tools/hil/README.md index d73eb49a5..324f763b7 100644 --- a/tools/hil/README.md +++ b/tools/hil/README.md @@ -65,7 +65,7 @@ Each report counts what the session covered: connects, in-stream replies by type battery readings decoded, the status timer's requests, and command timeouts. Its events also say which driver timers were running after connect, after configure and while streaming. -Starting SD logging mid-stream (`startSDLogging()` while streaming) writes the RTC mid-stream, which a Shimmer3R answers with out-of-order timestamps (DEV-1245). Consensys never does that, and neither do these scenarios. +A Shimmer3R answers a clock write (`SET_RWC`) while it streams with out-of-order timestamps (DEV-1245, firmware). Up to 0.11.11_beta, `startSDLogging()` while streaming wrote the clock first. Since DEV-1337 the driver doesn't send a clock write to a streaming Shimmer3R; the connect sequence sets the clock. These scenarios start logging the Consensys way regardless. The stream checks are the Android HIL's (`StreamAnalysis`, the same class in ShimmerAndroidAPI's `shimmerHilTest`), so the two judge a stream by the same rules. `StreamAnalysisTest` runs in CI, as From 860d76e8ea7925cc72950db011d63e1fb53f33cb Mon Sep 17 00:00:00 2001 From: JongChern Date: Tue, 27 Oct 2026 11:19:07 +0800 Subject: [PATCH 2/2] DEV-1337: check for a streaming Shimmer3R in writeRealTimeClock() Move the check out of the IO thread: writeRealTimeClock() now queues nothing for a Shimmer3R that is streaming, and processNextInstruction() is back as it is on master. Every clock write goes through writeRealTimeClock(): the status rule, startSDLogging(), and Android's Shimmer.java. API_00027, API_00030 and API_00032 put a SET command in flight with startSDLogging() on a streaming Shimmer3R, which queued SET_RWC_COMMAND first. They now use the START_LOGGING_ONLY_COMMAND it queues alone, with GET_VBATT_COMMAND queued behind it where a test checks the next command survives. Co-Authored-By: Claude Opus 5.5 --- .../bluetooth/ShimmerBluetooth.java | 18 +++++++----------- .../API_00027_StreamingBareAckCrcTest.java | 19 +++++++------------ ...30_StreamingInstreamResponseQueueTest.java | 17 ++++++++++------- .../API_00032_StreamingAckAfterPauseTest.java | 9 +++++---- ..._00035_NoClockWriteWhileStreamingTest.java | 2 +- 5 files changed, 30 insertions(+), 35 deletions(-) diff --git a/ShimmerDriver/src/main/java/com/shimmerresearch/bluetooth/ShimmerBluetooth.java b/ShimmerDriver/src/main/java/com/shimmerresearch/bluetooth/ShimmerBluetooth.java index 118c05ac7..d23354449 100644 --- a/ShimmerDriver/src/main/java/com/shimmerresearch/bluetooth/ShimmerBluetooth.java +++ b/ShimmerDriver/src/main/java/com/shimmerresearch/bluetooth/ShimmerBluetooth.java @@ -720,14 +720,6 @@ private boolean processNextInstruction() { //checkAndRemoveFirstInstructionIfNull(); byte[] insBytes = getInstruction(); - if (insBytes!=null && insBytes[0]==SET_RWC_COMMAND && isRealTimeClockWriteBlocked()){ - // Dropped unsent: see isRealTimeClockWriteBlocked() - synchronized(mListofInstructions){ - mListofInstructions.remove(insBytes); - } - printLogDataForDebugging("SET_RWC_COMMAND not sent: the Shimmer3R is streaming (DEV-1337)"); - return true; - } if (insBytes!=null){ mCurrentCommand=insBytes[0]; setInstructionStackLock(true); @@ -3107,7 +3099,7 @@ private void initialiseStreaming(){ /** * Starts SD logging, writing the PC's time to the clock first. On a Shimmer3R that is streaming - * the clock write is not sent (see isRealTimeClockWriteBlocked()), and logging starts on the clock + * the clock isn't written (see isRealTimeClockWriteBlocked()), and logging starts on the clock * the connect sequence set. */ @Override @@ -4228,11 +4220,15 @@ public void readRealTimeClock(){ /** * Queues a write of the PC's time to the Shimmer's real-world clock; the time is read just before - * the command is sent. It is not sent to a Shimmer3R that is streaming by then (see + * the command is sent. Nothing is queued for a Shimmer3R that is streaming (see * isRealTimeClockWriteBlocked()): the connect sequence sets the clock instead. */ public void writeRealTimeClock(){ if(getFirmwareIdentifier()==FW_ID.LOGANDSTREAM){ + if(isRealTimeClockWriteBlocked()){ + printLogDataForDebugging("SET_RWC_COMMAND not queued: the Shimmer3R is streaming (DEV-1337)"); + return; + } //Just fill empty bytes here for RTC, set them just before writing to Shimmer byte[] bytearraycommand= new byte[9]; bytearraycommand[0]=SET_RWC_COMMAND; @@ -4241,7 +4237,7 @@ public void writeRealTimeClock(){ } /** - * Whether a clock write must not be sent now. On a Shimmer3R the counter that stamps each + * Whether a clock write must not be queued now. On a Shimmer3R the counter that stamps each * streamed packet is the real-world clock, so setting the clock mid-stream steps it: packets come * out off the sample grid and sometimes behind the one before, and a step back beyond the * timestamp unwrap's reorder window reads as a counter wrap, stamping the rest of the session diff --git a/ShimmerDriverPC/src/test/java/com/shimmerresearch/bluetooth/API_00027_StreamingBareAckCrcTest.java b/ShimmerDriverPC/src/test/java/com/shimmerresearch/bluetooth/API_00027_StreamingBareAckCrcTest.java index 12c9dc5fc..912125651 100644 --- a/ShimmerDriverPC/src/test/java/com/shimmerresearch/bluetooth/API_00027_StreamingBareAckCrcTest.java +++ b/ShimmerDriverPC/src/test/java/com/shimmerresearch/bluetooth/API_00027_StreamingBareAckCrcTest.java @@ -183,30 +183,25 @@ private void assertBuffered(byte... expected) { } /** - * 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) { streamingShimmer3r(crcMode); mDevice.startSDLogging(); - - sendNextInstruction(); - assertEquals(ShimmerObject.SET_RWC_COMMAND, mDevice.mCurrentCommand); - receive(dataPacket(payload(1), crcMode), bareAck(crcMode), - dataPacket(payload(2), crcMode), dataPacket(payload(3), crcMode)); - assertAckProcessed(); - assertEquals("START_LOGGING_ONLY_COMMAND is still queued", 1, mDevice.getListofInstructions().size()); + assertEquals("only START_LOGGING_ONLY_COMMAND is queued", 1, mDevice.getListofInstructions().size()); sendNextInstruction(); assertEquals(ShimmerObject.START_LOGGING_ONLY_COMMAND, mDevice.mCurrentCommand); - receive(dataPacket(payload(4), crcMode), bareAck(crcMode), - dataPacket(payload(5), crcMode), new byte[] {ShimmerObject.DATA_PACKET}); + receive(dataPacket(payload(1), crcMode), bareAck(crcMode), + dataPacket(payload(2), crcMode), dataPacket(payload(3), crcMode), new byte[] {ShimmerObject.DATA_PACKET}); assertAckProcessed(); assertTrue(mDevice.getListofInstructions().isEmpty()); assertTrue(mDevice.isSDLogging()); assertEquals(BT_STATE.STREAMING_AND_SDLOGGING, mDevice.getBluetoothRadioState()); - assertParsed(payload(1), payload(2), payload(3), payload(4), payload(5)); + assertParsed(payload(1), payload(2), payload(3)); assertBuffered(ShimmerObject.DATA_PACKET); } diff --git a/ShimmerDriverPC/src/test/java/com/shimmerresearch/bluetooth/API_00030_StreamingInstreamResponseQueueTest.java b/ShimmerDriverPC/src/test/java/com/shimmerresearch/bluetooth/API_00030_StreamingInstreamResponseQueueTest.java index 1aba75222..66db792ee 100644 --- a/ShimmerDriverPC/src/test/java/com/shimmerresearch/bluetooth/API_00030_StreamingInstreamResponseQueueTest.java +++ b/ShimmerDriverPC/src/test/java/com/shimmerresearch/bluetooth/API_00030_StreamingInstreamResponseQueueTest.java @@ -181,25 +181,28 @@ private void assertCompleted() { } /** - * startSDLogging() queues SET_RWC_COMMAND and START_LOGGING_ONLY_COMMAND. A - * status push between SET_RWC_COMMAND and its ACK must leave both queued, and - * the ACK must then complete SET_RWC_COMMAND, not START_LOGGING_ONLY_COMMAND. + * startSDLogging() queues START_LOGGING_ONLY_COMMAND (no clock write to a + * streaming Shimmer3R, DEV-1337), and readBattery() queues GET_VBATT_COMMAND + * behind it. A status push between START_LOGGING_ONLY_COMMAND and its ACK must + * leave both queued, and the ACK must then complete START_LOGGING_ONLY_COMMAND, + * not GET_VBATT_COMMAND. */ private void statusPushWhileASetCommandAwaitsItsAck(BT_CRC_MODE crcMode) { streamingShimmer3r(crcMode); mDevice.startSDLogging(); + mDevice.readBattery(); assertEquals(2, mDevice.getListofInstructions().size()); sendNextInstruction(); - assertEquals(ShimmerObject.SET_RWC_COMMAND, mDevice.mCurrentCommand); + assertEquals(ShimmerObject.START_LOGGING_ONLY_COMMAND, mDevice.mCurrentCommand); receive(dataPacket(1, crcMode), statusPush(crcMode), dataPacket(2, crcMode)); assertTrue("the status push is still processed", mDevice.isDocked()); - assertStillWaitingFor(ShimmerObject.SET_RWC_COMMAND, 2); + assertStillWaitingFor(ShimmerObject.START_LOGGING_ONLY_COMMAND, 2); receive(dataPacket(3, crcMode), bareAck(crcMode), dataPacket(4, crcMode), dataPacket(5, crcMode)); assertCompleted(); - assertEquals("START_LOGGING_ONLY_COMMAND is still queued", 1, mDevice.getListofInstructions().size()); - assertEquals(ShimmerObject.START_LOGGING_ONLY_COMMAND, mDevice.getListofInstructions().get(0)[0]); + assertEquals("GET_VBATT_COMMAND is still queued", 1, mDevice.getListofInstructions().size()); + assertEquals(ShimmerObject.GET_VBATT_COMMAND, mDevice.getListofInstructions().get(0)[0]); } @Test diff --git a/ShimmerDriverPC/src/test/java/com/shimmerresearch/bluetooth/API_00032_StreamingAckAfterPauseTest.java b/ShimmerDriverPC/src/test/java/com/shimmerresearch/bluetooth/API_00032_StreamingAckAfterPauseTest.java index 69f5e4e5d..3c20f522d 100644 --- a/ShimmerDriverPC/src/test/java/com/shimmerresearch/bluetooth/API_00032_StreamingAckAfterPauseTest.java +++ b/ShimmerDriverPC/src/test/java/com/shimmerresearch/bluetooth/API_00032_StreamingAckAfterPauseTest.java @@ -251,16 +251,17 @@ public void batteryReplyInThePauseWithTwoByteCrc() { private void bareAckInThePause(BT_CRC_MODE crcMode) { streamingShimmer3r(crcMode); mDevice.stopSDLogging(); - mDevice.startSDLogging(); // SET_RWC_COMMAND, then START_LOGGING_ONLY_COMMAND + mDevice.startSDLogging(); // START_LOGGING_ONLY_COMMAND: no clock write to a streaming Shimmer3R (DEV-1337) + mDevice.readBattery(); assertEquals(3, mDevice.getListofInstructions().size()); stopLoggingAndReceiveItsAck(crcMode); sendNextInstruction(); - assertEquals(ShimmerObject.SET_RWC_COMMAND, mDevice.mCurrentCommand); + assertEquals(ShimmerObject.START_LOGGING_ONLY_COMMAND, mDevice.mCurrentCommand); receive(bareAck(crcMode), dataPacket(2, crcMode), new byte[] {ShimmerObject.DATA_PACKET}); assertCompleted(); - assertEquals("START_LOGGING_ONLY_COMMAND is still queued", 1, mDevice.getListofInstructions().size()); - assertEquals(ShimmerObject.START_LOGGING_ONLY_COMMAND, mDevice.getListofInstructions().get(0)[0]); + assertEquals("GET_VBATT_COMMAND is still queued", 1, mDevice.getListofInstructions().size()); + assertEquals(ShimmerObject.GET_VBATT_COMMAND, mDevice.getListofInstructions().get(0)[0]); assertParsed(payload(1), payload(2)); } diff --git a/ShimmerDriverPC/src/test/java/com/shimmerresearch/bluetooth/API_00035_NoClockWriteWhileStreamingTest.java b/ShimmerDriverPC/src/test/java/com/shimmerresearch/bluetooth/API_00035_NoClockWriteWhileStreamingTest.java index d42a0e64f..900517dbc 100644 --- a/ShimmerDriverPC/src/test/java/com/shimmerresearch/bluetooth/API_00035_NoClockWriteWhileStreamingTest.java +++ b/ShimmerDriverPC/src/test/java/com/shimmerresearch/bluetooth/API_00035_NoClockWriteWhileStreamingTest.java @@ -28,7 +28,7 @@ * startSDLogging() wrote the clock before every logging start, so starting logging mid-stream * triggered it every time; the Android HIL's midStreamSet and inStream failed on a Shimmer3R for it. *

- * The IO thread now drops a clock write unsent while a Shimmer3R streams. The connect sequence still + * writeRealTimeClock() now queues nothing while a Shimmer3R streams. The connect sequence still * writes the clock, and a Shimmer3, whose timestamps stay in order across a clock write, still gets * it mid-stream. *