Skip to content

Commit 36a15e7

Browse files
committed
DEV-651 #time 10m addressing PR comments
1 parent c2a8d51 commit 36a15e7

3 files changed

Lines changed: 12 additions & 10 deletions

File tree

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2309,6 +2309,9 @@ else if(currentCommand==SET_CRC_COMMAND){
23092309
else if(currentCommand==SET_TEST){
23102310
InShimmerTest = true;
23112311
}
2312+
else if (currentCommand == SET_FEATURE) {
2313+
// TODO: do something?
2314+
}
23122315
else {
23132316
//unhandled set command
23142317
printLogDataForDebugging("Unhandled set command: " + btCommandToString(currentCommand));
@@ -2644,8 +2647,8 @@ private void initializeShimmer3or3R(int hardwareVersion){
26442647
writeBtCommsCrcMode(DEFAULT_BT_CRC_MODE_IF_SUPPORTED);
26452648
}
26462649

2647-
if (RN4678_ERROR_DETECTION_ENABLED && isSupportedRn4678ErrorTest()) {
2648-
wristSetFeatureCommand(SHIMMER_FEATURE.RN4678_ERROR_DETECTION.ordinal(), 1);
2650+
if (RN4678_ERROR_DETECTION_ENABLED && isSupportedRn4678ErrorDetection()) {
2651+
writeSetFeatureCommand(SHIMMER_FEATURE.RN4678_ERROR_DETECTION.ordinal(), 1);
26492652
}
26502653

26512654
if (isSetupDeviceWhileConnecting()){
@@ -4643,7 +4646,12 @@ public void writeMemCommand(int command, int address, byte[] infoMemBytes) {
46434646
}
46444647
}
46454648

4646-
public void wristSetFeatureCommand(int feature, int setting){
4649+
/**
4650+
* writeSetFeatureCommand(feature, setting) sets a particular feature on the Shimmer device to the desired setting.
4651+
* @param feature is a numeric value defining the feature to be set.
4652+
* @param setting is a numeric value defining the desired setting for the feature. Example valid settings values are 0 (Disable feature) and 1 (Enable feature)
4653+
*/
4654+
public void writeSetFeatureCommand(int feature, int setting){
46474655
writeInstruction(new byte[]{SET_FEATURE, (byte)feature, (byte)setting});
46484656
}
46494657

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2166,7 +2166,7 @@ public static boolean isSupportedNoImuSensors(ShimmerVerObject svo, ExpansionBoa
21662166
}
21672167
}
21682168

2169-
public boolean isSupportedRn4678ErrorTest() {
2169+
public boolean isSupportedRn4678ErrorDetection() {
21702170
if((isShimmerGen3() && getFirmwareIdentifier()==ShimmerVerDetails.FW_ID.LOGANDSTREAM
21712171
&& mShimmerVerObject.compareVersions(HW_ID.SHIMMER_3, FW_ID.LOGANDSTREAM, 1, 0, 17))){
21722172
return true;

ShimmerDriver/src/main/java/com/shimmerresearch/sensors/bmpX80/SensorBMP390.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,24 +104,18 @@ public static final class ObjectClusterSensorName{
104104
public static final byte PRESSURE_CALIBRATION_COEFFICIENTS_RESPONSE = (byte) 0xA6;
105105
public static final byte GET_PRESSURE_CALIBRATION_COEFFICIENTS_COMMAND = (byte) 0xA7;
106106

107-
public static final byte SET_PRESSURE_SAMPLING_RATE_COMMAND = (byte) 0xB5;
108-
public static final byte PRESSURE_SAMPLING_RATE_RESPONSE = (byte) 0xB6;
109-
public static final byte GET_PRESSURE_SAMPLING_RATE_COMMAND = (byte) 0xB7;
110-
111107
public static final Map<Byte, BtCommandDetails> mBtGetCommandMap;
112108
static {
113109
Map<Byte, BtCommandDetails> aMap = new LinkedHashMap<Byte, BtCommandDetails>();
114110
aMap.put(GET_PRESSURE_OVERSAMPLING_RATIO_COMMAND, new BtCommandDetails(GET_PRESSURE_OVERSAMPLING_RATIO_COMMAND, "GET_PRESSURE_OVERSAMPLING_RATIO_COMMAND", PRESSURE_OVERSAMPLING_RATIO_RESPONSE));
115111
aMap.put(GET_PRESSURE_CALIBRATION_COEFFICIENTS_COMMAND, new BtCommandDetails(GET_PRESSURE_CALIBRATION_COEFFICIENTS_COMMAND, "GET_PRESSURE_CALIBRATION_COEFFICIENTS_COMMAND", PRESSURE_CALIBRATION_COEFFICIENTS_RESPONSE));
116-
aMap.put(GET_PRESSURE_SAMPLING_RATE_COMMAND, new BtCommandDetails(GET_PRESSURE_SAMPLING_RATE_COMMAND, "GET_PRESSURE_SAMPLING_RATE_COMMAND", PRESSURE_SAMPLING_RATE_RESPONSE));
117112
mBtGetCommandMap = Collections.unmodifiableMap(aMap);
118113
}
119114

120115
public static final Map<Byte, BtCommandDetails> mBtSetCommandMap;
121116
static {
122117
Map<Byte, BtCommandDetails> aMap = new LinkedHashMap<Byte, BtCommandDetails>();
123118
aMap.put(SET_PRESSURE_OVERSAMPLING_RATIO_COMMAND, new BtCommandDetails(SET_PRESSURE_OVERSAMPLING_RATIO_COMMAND, "SET_PRESSURE_OVERSAMPLING_RATIO_COMMAND"));
124-
aMap.put(SET_PRESSURE_SAMPLING_RATE_COMMAND, new BtCommandDetails(SET_PRESSURE_SAMPLING_RATE_COMMAND, "SET_PRESSURE_SAMPLING_RATE_COMMAND"));
125119
mBtSetCommandMap = Collections.unmodifiableMap(aMap);
126120
}
127121
//--------- Bluetooth commands end --------------

0 commit comments

Comments
 (0)