Skip to content

Commit 0d0efd6

Browse files
marknolanCopilot
andauthored
Update ShimmerDriver/src/main/java/com/shimmerresearch/bluetooth/ShimmerBluetooth.java
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent a21639a commit 0d0efd6

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

ShimmerDriver/src/main/java/com/shimmerresearch/bluetooth/ShimmerBluetooth.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,6 +1317,12 @@ protected void discardBufferBytesToNextPacket(){
13171317
consolePrintLn("Throw Bytes " + UtilShimmer.bytesToHexStringWithSpacesFormatted(Arrays.copyOfRange(bTemp, 0, offset)));
13181318
}
13191319

1320+
/**
1321+
* Finds the offset/index of the next DATA_PACKET (0x00) or ACK_COMMAND_PROCESSED (0xFF) byte.
1322+
*
1323+
* @param a byte array to search within
1324+
* @return index of the first 0x00 or 0xFF byte found after position 0, or -1 if not found
1325+
*/
13201326
private static int findOffsetOfNextZeroOrFF(byte[] buffer) {
13211327
for (int i = 1; i < buffer.length; i++) {
13221328
byte b = buffer[i];

0 commit comments

Comments
 (0)