Skip to content

Commit a2d9f00

Browse files
committed
Imported api v2.8.0
1 parent dc7709f commit a2d9f00

File tree

8 files changed

+211
-28
lines changed

8 files changed

+211
-28
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.7.2'
23+
compile 'com.mbientlab:metawear:2.8.0'
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 38
35-
versionName "2.7.2"
34+
versionCode 40
35+
versionName "2.8.0"
3636
}
3737
buildTypes {
3838
release {

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ public class Constant {
4343
public static final byte EXTENDED_LOGGING_REVISION= 2;
4444

4545
public static final byte BMM150_MAGNETOMETER= 0;
46-
public static final byte SETTINGS_CONN_PARAMS_REVISION= 1, SETTINGS_DISCONNECTED_EVENT_REVISION= 2, SETTINGS_BATTERY_REVISION= 3, SETTINGS_WATCHDOG_REVISION= 4;
46+
public static final byte SETTINGS_CONN_PARAMS_REVISION= 1, SETTINGS_DISCONNECTED_EVENT_REVISION= 2, SETTINGS_BATTERY_REVISION= 3,
47+
SETTINGS_WATCHDOG_REVISION= 4, SETTINGS_CHARGE_STATUS_REVISION = 5;
48+
49+
public static final byte DATA_PROCESSOR_TIME_PASSTHROUGH_REVISION = 1;
4750

4851
public static final byte GSR_IMPLEMENTATION= 1;
4952
public static final byte GPIO_ENHANCED_ANALOG= 2;

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

Lines changed: 166 additions & 23 deletions
Large diffs are not rendered by default.

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ public ResponseHeader(byte module, byte register, byte id) {
5050
this.id= id;
5151
}
5252

53+
public ResponseHeader markAsRead() {
54+
return new ResponseHeader(module, (byte) (register | 0x80), id);
55+
}
56+
57+
public ResponseHeader clearRead() {
58+
return new ResponseHeader(module, (byte) (register & 0x7f), id);
59+
}
60+
5361
@Override
5462
public boolean equals(Object o) {
5563
///< Generated by IntelliJ

library/src/main/java/com/mbientlab/metawear/impl/characteristic/SettingsRegister.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ public enum SettingsRegister implements Register {
7777
BATTERY_STATE {
7878
@Override
7979
public byte opcode() { return 0xc; }
80+
},
81+
POWER_STATUS {
82+
@Override
83+
public byte opcode() { return 0x11; }
84+
},
85+
CHARGER_STATUS {
86+
@Override
87+
public byte opcode() { return 0x12; }
8088
};
8189

8290
@Override

library/src/main/java/com/mbientlab/metawear/module/Settings.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,16 @@ interface SourceSelector {
261261
* @return Object representing the data
262262
*/
263263
DataSignal fromBattery(boolean silent);
264+
/**
265+
* Handles notifications from the battery power status pin
266+
* @return Object representing the data
267+
*/
268+
DataSignal fromPowerStatus();
269+
/**
270+
* Handles notifications from the battery charger status pin
271+
* @return Object representing the data
272+
*/
273+
DataSignal fromChargerStatus();
264274
}
265275

266276
/**
@@ -283,4 +293,15 @@ interface SourceSelector {
283293
* @param silent True if it should be a silent read
284294
*/
285295
void readBatteryState(boolean silent);
296+
297+
/**
298+
* Read the current power status.
299+
* @return 1 if power source attached, 0 if removed; available when read operation is finished
300+
*/
301+
AsyncOperation<Byte> readPowerStatus();
302+
/**
303+
* Read the current charge status.
304+
* @return 1 if battery is charging, 0 if not charging; available when read operation is finished
305+
*/
306+
AsyncOperation<Byte> readChargeStatus();
286307
}

library/src/main/java/com/mbientlab/metawear/processor/Passthrough.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public State(short newValue) {
6262
public enum Mode {
6363
/** Allow all data through */
6464
ALL,
65-
/** Only allow data through if value > 0 */
65+
/** Only allow data through if value &gt; 0 */
6666
CONDITIONAL,
6767
/** Only allow a fixed number of data samples through */
6868
COUNT

0 commit comments

Comments
 (0)