Software representation of all MbientLab sensor boards.
More...
|
string | MacAddress [get] |
| Unique MAC address identifying the board More...
|
|
bool | InMetaBootMode [get] |
| True if the board is in MetaBoot (bootloader) mode.
More...
|
|
Model | Model [get] |
| Gets the model of the connected board, returns null if unable to determine More...
|
|
String | ModelString [get] |
| Gets the string representation of the board's model, null if unable to determine More...
|
|
Action | OnUnexpectedDisconnect [get, set] |
| Called when the connection is unexpectedly lost i.e. not requested by the API More...
|
|
int | TimeForResponse [set] |
| How long the API should wait (in milliseconds) before a required response is received More...
|
|
bool | IsConnected [get] |
| True if the board is currently connected to the host device More...
|
|
Software representation of all MbientLab sensor boards.
Call InitializeAsync before using any other functions or reading the properties.
◆ CreateAnonymousRoutesAsync()
Task<IList<IAnonymousRoute> > MbientLab.MetaWear.IMetaWearBoard.CreateAnonymousRoutesAsync |
( |
| ) |
|
Reads the current state of the board and creates anonymous routes based on what data is being logged
- Returns
- List of created anonymous route objects
◆ DeserializeAsync()
Task MbientLab.MetaWear.IMetaWearBoard.DeserializeAsync |
( |
| ) |
|
Restore serialized state from the local disk if available
- Returns
- Null when the object state is restored
◆ DisconnectAsync()
Task MbientLab.MetaWear.IMetaWearBoard.DisconnectAsync |
( |
| ) |
|
Disconnects from the MetaWear device
This method is only meaningful for non Windows 10 applications due to quirks with Win10's BLE stack. For consistent behavior across all platforms, use the IDebug.DisconnectAsync instead to terminate the connection
- Returns
- Null when the connection is closed
◆ GetModule< T >()
T MbientLab.MetaWear.IMetaWearBoard.GetModule< T > |
( |
| ) |
|
Retrieves a reference to the requested module if supported.
The API must be initialized before calling this function and it cannot be used if the board is in MetaBoot mode.
- Template Parameters
-
T | Interface derived from IModule to lookup |
- Returns
- Reference to the requested module, null if the board is not connected, module not supported, or board is in MetaBoot mode
◆ GetModuleInfoAsync()
Task<IDictionary> MbientLab.MetaWear.IMetaWearBoard.GetModuleInfoAsync |
( |
IDictionary |
partial | ) |
|
Queries all info registers. If the task times out, you can run the task again using the partially completed result from the previous execution so the function does not need to query all modules again.
- Parameters
-
partial | Result of previously queried module info results, set to null to query all modules |
- Returns
- Module information contained in a string indexed dictionary
- Exceptions
-
TaskTimeoutException | If the module responses take too long, partial result is included with this exception |
◆ InitializeAsync()
Task MbientLab.MetaWear.IMetaWearBoard.InitializeAsync |
( |
| ) |
|
Connect to the remote device and perpares the internal API state to communicate with the modules.
- Parameters
-
timeout | How long to wait (in milliseconds) for initialization to complete |
- Returns
- Null once the SDK is initialized
- Exceptions
-
TimeoutException | If initialization takes too long, timeout can be increased with the TimeForResponse property |
InvalidOperationException | If the host device failed to establish a connection |
◆ LookupObserver()
IObserver MbientLab.MetaWear.IMetaWearBoard.LookupObserver |
( |
uint |
id | ) |
|
Retrieves an observer
- Parameters
-
id | Numerical ID to look up |
- Returns
- IObserver corresponding to the specified ID, null if none can be found
◆ LookupRoute()
IRoute MbientLab.MetaWear.IMetaWearBoard.LookupRoute |
( |
uint |
id | ) |
|
Retrieves a route
- Parameters
-
id | Numerical ID to look up |
- Returns
- IRoute corresponding to the specified ID, null if none can be found
◆ LookupScheduledTask()
IScheduledTask MbientLab.MetaWear.IMetaWearBoard.LookupScheduledTask |
( |
byte |
id | ) |
|
Retrieves a scheduled task
- Parameters
-
- Returns
- IScheduledTask corresonding to the specified ID, null if non can be found
◆ ReadBatteryLevelAsync()
Task<byte> MbientLab.MetaWear.IMetaWearBoard.ReadBatteryLevelAsync |
( |
| ) |
|
Reads the battery level characteristic
- Returns
- Value of the characteristic
◆ ReadDeviceInformationAsync()
Task<DeviceInformation> MbientLab.MetaWear.IMetaWearBoard.ReadDeviceInformationAsync |
( |
| ) |
|
Reads supported characteristics from the Device Information service
- Returns
- Object encapsulating the device information
◆ ScheduleAsync() [1/2]
Task<IScheduledTask> MbientLab.MetaWear.IMetaWearBoard.ScheduleAsync |
( |
uint |
period, |
|
|
ushort |
repititions, |
|
|
bool |
delay, |
|
|
Action |
commands |
|
) |
| |
Schedule a task to be indefinitely executed on-board at fixed intervals for a specific number of repetitions
- Parameters
-
period | How often to execute the task, in milliseconds |
repititions | How many times to execute the task |
delay | True if first execution should be delayed by one period |
commands | MetaWear commands comprising the task |
- Returns
- IScheduledTask object representing the newly scheduled task
- Exceptions
-
TimeoutException | If creating the timer or programming the commands timed out |
◆ ScheduleAsync() [2/2]
Task<IScheduledTask> MbientLab.MetaWear.IMetaWearBoard.ScheduleAsync |
( |
uint |
period, |
|
|
bool |
delay, |
|
|
Action |
commands |
|
) |
| |
Schedule a task to be indefinitely executed on-board at fixed intervals indefinitely
- Parameters
-
period | How often to execute the task, in milliseconds |
delay | True if first execution should be delayed by one period |
commands | MetaWear commands comprising the task |
- Returns
- IScheduledTask object representing the newly scheduled task
- Exceptions
-
TimeoutException | If creating the timer or programming the commands timed out |
◆ SerializeAsync()
Task MbientLab.MetaWear.IMetaWearBoard.SerializeAsync |
( |
| ) |
|
Serialize object state and write the state to the local disk
- Returns
- Null when the object state is saved
◆ TearDown()
void MbientLab.MetaWear.IMetaWearBoard.TearDown |
( |
| ) |
|
Removes all routes and resources allocated on the board (observers, data processors, timers, and loggers)
◆ InMetaBootMode
bool MbientLab.MetaWear.IMetaWearBoard.InMetaBootMode |
|
get |
True if the board is in MetaBoot (bootloader) mode.
If it is, you will not be able to interact with the board except to update firmware
◆ IsConnected
bool MbientLab.MetaWear.IMetaWearBoard.IsConnected |
|
get |
True if the board is currently connected to the host device
◆ MacAddress
string MbientLab.MetaWear.IMetaWearBoard.MacAddress |
|
get |
Unique MAC address identifying the board
◆ Model
Model MbientLab.MetaWear.IMetaWearBoard.Model |
|
get |
Gets the model of the connected board, returns null if unable to determine
◆ ModelString
String MbientLab.MetaWear.IMetaWearBoard.ModelString |
|
get |
Gets the string representation of the board's model, null if unable to determine
◆ OnUnexpectedDisconnect
Action MbientLab.MetaWear.IMetaWearBoard.OnUnexpectedDisconnect |
|
getset |
Called when the connection is unexpectedly lost i.e. not requested by the API
◆ TimeForResponse
int MbientLab.MetaWear.IMetaWearBoard.TimeForResponse |
|
set |
How long the API should wait (in milliseconds) before a required response is received
The documentation for this interface was generated from the following file:
- MetaWear/IMetaWearBoard.cs