public interface MetaWearBoard
Modifier and Type | Interface and Description |
---|---|
static class |
MetaWearBoard.ConnectionStateHandler
Class for handling Bluetooth LE connection events
|
static interface |
MetaWearBoard.DeviceInformation
Wrapper class around the data from the device information service
|
static interface |
MetaWearBoard.DfuProgressHandler
Deprecated.
The API will no longer perform firmware updates in future releases. Instead, the dfu will be handled with Nordic's
Android DFU library.
|
static interface |
MetaWearBoard.Module
Base class for on-board sensors or features supported by the board's firmware
|
Modifier and Type | Field and Description |
---|---|
static java.util.UUID |
META_WEAR_SERVICE_UUID
Deprecated.
|
static java.util.UUID |
METABOOT_SERVICE_UUID
Service UUID identifying a MetaWear board in MetaBoot mode
|
static java.util.UUID |
METAWEAR_SERVICE_UUID
Service UUID identifying a MetaWear board.
|
Modifier and Type | Method and Description |
---|---|
void |
abortFirmwareUpdate()
Deprecated.
The API will no longer perform firmware updates in future releases. Instead, the dfu will be handled with Nordic's
Android DFU library.
|
AsyncOperation<java.lang.Boolean> |
checkForFirmwareUpdate()
Checks if there is a newer version of the firmware available for your board.
|
void |
connect()
Establish a connection to the board and prepare the API to communicate with the board.
|
void |
deserializeState(byte[] state)
Updates the internal state with the values in the byte array
|
void |
disconnect()
Close the connection to the board
|
AsyncOperation<java.io.File> |
downloadLatestFirmware()
Downloads the latest firmware release for the board to your Android device.
|
java.lang.String |
getMacAddress()
Retrieves the MAC address of the board
|
<T extends MetaWearBoard.Module> |
getModule(java.lang.Class<T> moduleClass)
Retrieves a pointer to the requested module, if supported by the current board and firmware, and
the board is not in MetaBoot mode.
|
RouteManager |
getRouteManager(int id)
Retrieves a route manager
|
boolean |
inMetaBootMode()
Checks if the board is in MetaBoot mode
|
boolean |
isConnected()
Retrieves the connection state
|
<T extends MetaWearBoard.Module> |
lookupModule(java.lang.Class<T> moduleClass)
Variant of #
getModule(Class) that does not throw a checked exception. |
AsyncOperation<java.lang.Byte> |
readBatteryLevel()
Reads the battery level characteristic
|
AsyncOperation<MetaWearBoard.DeviceInformation> |
readDeviceInformation()
Reads supported characteristics from the Device Information service
|
AsyncOperation<java.lang.Integer> |
readRssi()
Reads the current RSSI value
|
void |
removeRoutes()
Remove all data routes
|
byte[] |
serializeState()
Serializes the internal state of the class
|
void |
setConnectionStateHandler(MetaWearBoard.ConnectionStateHandler handler)
Sets the connection state handler
|
void |
tearDown()
Removes all routes and timers from the board.
|
AsyncOperation<java.lang.Void> |
updateFirmware(java.io.File firmwareHexPath,
MetaWearBoard.DfuProgressHandler handler)
Deprecated.
The API will no longer perform firmware updates in future releases. Instead, the dfu will be handled with Nordic's
Android DFU library.
|
AsyncOperation<java.lang.Void> |
updateFirmware(java.io.InputStream firmwareStream,
MetaWearBoard.DfuProgressHandler handler)
Deprecated.
The API will no longer perform firmware updates in future releases. Instead, the dfu will be handled with Nordic's
Android DFU library.
|
AsyncOperation<java.lang.Void> |
updateFirmware(MetaWearBoard.DfuProgressHandler handler)
Deprecated.
The API will no longer perform firmware updates in future releases. Instead, the dfu will be handled with Nordic's
Android DFU library.
|
static final java.util.UUID METAWEAR_SERVICE_UUID
@Deprecated static final java.util.UUID META_WEAR_SERVICE_UUID
METAWEAR_SERVICE_UUID
insteadstatic final java.util.UUID METABOOT_SERVICE_UUID
java.lang.String getMacAddress()
boolean inMetaBootMode()
@Deprecated AsyncOperation<java.lang.Void> updateFirmware(MetaWearBoard.DfuProgressHandler handler)
disconnected()
callback function. You must be connected to the board
before calling this function, otherwise, it will fail.handler
- Handler for processing DFU progress notificationsdownloadLatestFirmware()
@Deprecated AsyncOperation<java.lang.Void> updateFirmware(java.io.File firmwareHexPath, MetaWearBoard.DfuProgressHandler handler)
disconnected()
callback function. You must be connected
to the board before calling this feature, otherwise, it will fail.firmwareHexPath
- Path to the firmware filehandler
- Handler for processing DFU progress notificationsdownloadLatestFirmware()
@Deprecated AsyncOperation<java.lang.Void> updateFirmware(java.io.InputStream firmwareStream, MetaWearBoard.DfuProgressHandler handler)
disconnected()
callback function. You must be connected
to the board before calling this feature, otherwise, it will fail.firmwareStream
- Path to the firmware filehandler
- Handler for processing DFU progress notificationsdownloadLatestFirmware()
@Deprecated void abortFirmwareUpdate()
downloadLatestFirmware()
AsyncOperation<java.io.File> downloadLatestFirmware()
AsyncOperation<java.lang.Boolean> checkForFirmwareUpdate()
<T extends MetaWearBoard.Module> T getModule(java.lang.Class<T> moduleClass) throws UnsupportedModuleException
moduleClass
- Module class to lookupUnsupportedModuleException
- if the module is not available on the board, or the board is in
MetaBoot mode<T extends MetaWearBoard.Module> T lookupModule(java.lang.Class<T> moduleClass)
getModule(Class)
that does not throw a checked exception. The API must be
connected to the board to use this function.moduleClass
- Module class to lookupAsyncOperation<MetaWearBoard.DeviceInformation> readDeviceInformation()
AsyncOperation<java.lang.Integer> readRssi()
AsyncOperation<java.lang.Byte> readBatteryLevel()
void setConnectionStateHandler(MetaWearBoard.ConnectionStateHandler handler)
handler
- Handler to use for connection eventsvoid connect()
failure
callback
function will be called with a TimeoutExceptionvoid disconnect()
boolean isConnected()
RouteManager getRouteManager(int id)
id
- Numerical ID to look upvoid removeRoutes()
void tearDown()
byte[] serializeState()
void deserializeState(byte[] state)
state
- New state of the class