Skip to content

Commit 6f15599

Browse files
committed
Imported api v2.8.5
1 parent a2d9f00 commit 6f15599

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Then, add the compile element to the dependencies closure in the module's *build
2020

2121
```gradle
2222
dependencies {
23-
compile 'com.mbientlab:metawear:2.8.0'
23+
compile 'com.mbientlab:metawear:2.8.5'
2424
}
2525
```
2626

library/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ android {
3131
defaultConfig {
3232
minSdkVersion 18
3333
targetSdkVersion 24
34-
versionCode 40
35-
versionName "2.8.0"
34+
versionCode 42
35+
versionName "2.8.5"
3636
}
3737
buildTypes {
3838
release {

library/src/main/java/com/mbientlab/metawear/data/Bmi160LowHighMessage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public Sign highSign() {
8181
@Override
8282
public String toString() {
8383
return String.format("{low: %s, high: %s, high_x: %s, high_y: %s, high_z: %s, high_direction: %s}",
84-
isLow(), isLow(), highG(Axis.X), highG(Axis.Y), highG(Axis.Z), highSign().toString());
84+
isLow(), isHigh(), highG(Axis.X), highG(Axis.Y), highG(Axis.Z), highSign().toString());
8585
}
8686
};
8787
}

library/src/main/java/com/mbientlab/metawear/data/Bmi160MotionMessage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ public boolean anyMotionDetected(Axis axis) {
3535

3636
@Override
3737
public String toString() {
38-
return String.format("{any_motion_x: %s, any_motion_y: %s, any_motion_z: %s}",
39-
anyMotionDetected(Axis.X), anyMotionDetected(Axis.Y), anyMotionDetected(Axis.Z));
38+
return String.format("{any_motion_sign: %s, any_motion_x: %s, any_motion_y: %s, any_motion_z: %s}",
39+
anyMotionSign(), anyMotionDetected(Axis.X), anyMotionDetected(Axis.Y), anyMotionDetected(Axis.Z));
4040
}
4141
};
4242
}

library/src/main/java/com/mbientlab/metawear/impl/DefaultMetaWearBoard.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4601,8 +4601,9 @@ public void receivedResponse(byte[] response) {
46014601
readResponses.get(header).process(response);
46024602
} else if (responses.containsKey(maskedHeader)) {
46034603
final Response resp= responses.get(maskedHeader).process(response);
4604-
if (resp != null && responseProcessors.containsKey(resp.header)) {
4605-
final RouteManager.MessageHandler handler= responseProcessors.get(resp.header);
4604+
ResponseHeader masked = resp.header.clearRead();
4605+
if (resp != null && responseProcessors.containsKey(masked)) {
4606+
final RouteManager.MessageHandler handler= responseProcessors.get(masked);
46064607
conn.executeTask(new Runnable() {
46074608
@Override
46084609
public void run() {
@@ -7244,7 +7245,7 @@ public SlowMotionConfigEditor setThreshold(float threshold) {
72447245
public void commit() {
72457246
if (count != null) {
72467247
motionConfig[0]&= 0x3;
7247-
motionConfig[0]|= (count << 2);
7248+
motionConfig[0]|= (count - 1) << 2;
72487249
}
72497250
if (threshold != null) {
72507251
noMotionThs= threshold;
@@ -7833,7 +7834,7 @@ public void commit() {
78337834

78347835
@Override
78357836
public ThresholdDetectionConfigEditor configureThresholdDetection() {
7836-
final byte THS_SCALE= 6;
7837+
final byte THS_SCALE= 16;
78377838

78387839
return new ThresholdDetectionConfigEditor() {
78397840
private byte[] config= new byte[2];
@@ -8103,7 +8104,7 @@ public void commit() {
81038104
motionConfig[0]&= 0x3;
81048105

81058106
if (duration >= 1000 && duration <= 16000) {
8106-
motionConfig[0]|= ((byte) (duration / 1000 - 1000)) << 2;
8107+
motionConfig[0]|= (byte) (((duration - 1000) / 1000) << 2);
81078108
} else if (duration >= 20000 && duration <= 80000) {
81088109
motionConfig[0]|= (((byte) (duration - 20000) / 4000) << 2) | 0x40;
81098110
} else if (duration >= 88000 && duration <= 336000) {
@@ -8347,11 +8348,11 @@ public void commit() {
83478348
lowHighConfig[2]|= (lowGMode.ordinal() << 2);
83488349
}
83498350
if (lowHysteresis != null) {
8350-
bmi160LowHighConfig[2]&= 0xfc;
8351-
bmi160LowHighConfig[2]|= ((byte) (lowHysteresis / LOW_HYSTERESIS_STEP) & 0x3);
8351+
lowHighConfig[2]&= 0xfc;
8352+
lowHighConfig[2]|= ((byte) (lowHysteresis / LOW_HYSTERESIS_STEP) & 0x3);
83528353
}
83538354
if (highDuration != null) {
8354-
bmi160LowHighConfig[3]= (byte) ((highDuration / DURATION_STEP) - 1);
8355+
lowHighConfig[3]= (byte) ((highDuration / DURATION_STEP) - 1);
83558356
}
83568357
if (newHighThreshold != null) {
83578358
highThreshold= newHighThreshold;

0 commit comments

Comments
 (0)