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.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
Service UUID identifying a MetaWear board.
|
Modifier and Type | Method and Description |
---|---|
void |
connect()
Establish a connection to 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
|
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
|
RouteManager |
getRouteManager(int id)
Retrieves a route manager
|
boolean |
isConnected()
Retrieves the connection state
|
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
|
static final java.util.UUID META_WEAR_SERVICE_UUID
java.lang.String getMacAddress()
<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 boardAsyncOperation<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()
void disconnect()
boolean isConnected()
RouteManager getRouteManager(int id)
id
- Numerical ID to look upvoid removeRoutes()
byte[] serializeState()
void deserializeState(byte[] state)
state
- New state of the class