Skip to content

Commit db28957

Browse files
committed
DEV-574 #time 5m removed contiguous check
1 parent 834c5bc commit db28957

3 files changed

Lines changed: 0 additions & 51 deletions

File tree

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,10 +1190,6 @@ private void buildAndSendMsg(byte[] packet, COMMUNICATION_TYPE fwType, boolean t
11901190
ObjectCluster objectCluster = null;
11911191
try {
11921192
objectCluster = buildMsg(packet, fwType, timeSync, pcTimeStamp);
1193-
if(objectCluster.successfullyParsed==false){
1194-
printLogDataForDebugging("Packet timestamp is not contiguous - skipping:\t\t" + UtilShimmer.bytesToHexStringWithSpacesFormatted(packet));
1195-
return;
1196-
}
11971193
objectCluster = systemTimestampPlot.processSystemTimestampPlot(objectCluster);
11981194
} catch (Exception e) {
11991195
e.printStackTrace();
@@ -2818,7 +2814,6 @@ public void startStreaming() throws ShimmerException {
28182814

28192815
initialiseStreaming();
28202816

2821-
super.mLastReceivedTimeStampTicks = 0;
28222817
mByteArrayOutputStream.reset();
28232818
mListofPCTimeStamps.clear();
28242819
writeInstruction(START_STREAMING_COMMAND);

ShimmerDriver/src/main/java/com/shimmerresearch/driver/ObjectCluster.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,6 @@ public enum OBJECTCLUSTER_TYPE{
157157
public int mIndexUncal = 0;
158158
public boolean mEnableArraysDataStructure = false;
159159

160-
/**
161-
* Indicates whether the packet was successfully parsed. Set to false when validation checks
162-
* fail (e.g., timestamp contiguity check) to signal that the ObjectCluster should be discarded.
163-
*/
164-
public boolean successfullyParsed = true;
165-
166160
public class SensorDataPerType {
167161

168162
public SensorDataPerType(int length) {

ShimmerDriver/src/main/java/com/shimmerresearch/driver/ShimmerObject.java

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -494,23 +494,6 @@ public class BTStream {
494494
public static final int MAX_NUMBER_OF_SIGNALS = 77;//50; //used to be 11 but now 13 because of the SR30 + 8 for 3d orientation
495495
public static final int MAX_INQUIRY_PACKET_SIZE = 47;
496496

497-
/**
498-
* Maximum allowed gap between consecutive packet timestamps in ticks (10 seconds at 32768 Hz).
499-
* Used to detect corrupted packets that pass CRC checks.
500-
* <p>
501-
* Why 10 seconds: Empirically chosen to balance between catching data corruption and allowing for
502-
* occasional transmission delays. This value can be tuned based on expected packet arrival rates.
503-
* <p>
504-
* Setting to 0 disables this check entirely.
505-
* <p>
506-
* Relationship to timestamp rollover: This value must be less than half the timestamp rollover period
507-
* (i.e., the maximum value before the timestamp counter wraps) to avoid false positives due to rollover.
508-
* <p>
509-
* Sampling rate: The value is calculated for a 32768 Hz sampling rate. If a different sampling rate is used,
510-
* this value should be adjusted accordingly (ticks = seconds * sampling rate).
511-
*/
512-
public static int CONTIGUOUS_TIMESTAMP_TICKS_LIMIT = (10*32768);
513-
514497
public enum TEST_MODE {
515498
MAIN_TEST((byte)0, "Main Test"),
516499
LED_TEST((byte)1, "LED Test"),
@@ -802,11 +785,6 @@ public String toString() {
802785
protected boolean mPastGSRFirstTime=true; // this is to fix a bug with SDLog v0.9
803786

804787
// ---------- GSR end ------------------
805-
806-
/**
807-
* Stores the last received timestamp in ticks (for detecting corrupted packets).
808-
*/
809-
protected double mLastReceivedTimeStampTicks = 0;
810788

811789
public ObjectCluster setLSLTimeIfAvailable(ObjectCluster ojc) {
812790
return ojc;
@@ -945,24 +923,6 @@ public ObjectCluster buildMsg(byte[] newPacket, COMMUNICATION_TYPE fwType, boole
945923

946924
if (getHardwareVersion()==HW_ID.SHIMMER_SR30 || getHardwareVersion()==HW_ID.SHIMMER_3 || getHardwareVersion()==HW_ID.SHIMMER_3R
947925
|| getHardwareVersion()==HW_ID.SHIMMER_GQ_802154_LR || getHardwareVersion()==HW_ID.SHIMMER_GQ_802154_NR || getHardwareVersion()==HW_ID.SHIMMER_2R_GQ){
948-
949-
/*
950-
* Even with checking for start and stop of packets while parsing and performing
951-
* CRC checks, some corrupted packets can still slip through. This is a final
952-
* check to help make sure the time stamp ticks are contiguous before parsing the
953-
* packet.
954-
*/
955-
if (fwType == COMMUNICATION_TYPE.BLUETOOTH && CONTIGUOUS_TIMESTAMP_TICKS_LIMIT != 0)
956-
{
957-
double shimmerTimestampTicks = (double)newPacketInt[getSignalIndex(Configuration.Shimmer3.ObjectClusterSensorName.TIMESTAMP)];
958-
if(mLastReceivedTimeStampTicks!=0
959-
&& Math.abs(shimmerTimestampTicks - mLastReceivedTimeStampTicks) > CONTIGUOUS_TIMESTAMP_TICKS_LIMIT) {
960-
objectCluster.successfullyParsed = false;
961-
return objectCluster; //discard packet
962-
}
963-
mLastReceivedTimeStampTicks = shimmerTimestampTicks;
964-
}
965-
966926
parseTimestampShimmer3(fwType, objectCluster, uncalibratedData, uncalibratedDataUnits, calibratedData, calibratedDataUnits, sensorNames, newPacketInt);
967927

968928
//OFFSET

0 commit comments

Comments
 (0)