metawearesteps
v0.0.1
Published
Metawear SDK for IOS Android
Downloads
2
Readme
metawear
Metawear SDK for IOS Android
Install
npm install metawear
npx cap sync
API
echo(...)
initialize()
search()
testFunc(...)
connect(...)
connectSensor1(...)
connectSensor2(...)
disconnect(...)
startData()
startAccelData(...)
stopAccelData()
startGyroData()
stopGyroData()
stopData()
downloadData()
stopLogs()
checkSensorsConnections()
reconnectSensors()
reconnectSensor1()
reconnectSensor2()
downloadDataSensor1()
downloadDataSensor2()
disconnectSensor2()
disconnectSensor1()
- Interfaces
echo(...)
echo(options: { value: string; }) => Promise<{ value: string; }>
| Param | Type |
| ------------- | ------------------------------- |
| options
| { value: string; } |
Returns: Promise<{ value: string; }>
initialize()
initialize() => Promise<null>
Initialize Permissions.
Returns: Promise<null>
search()
search() => Promise<null>
Connects to the metawear sensor.
Returns: Promise<null>
testFunc(...)
testFunc(data: DeviceOptions) => Promise<null>
| Param | Type |
| ---------- | ------------------------------------------------------- |
| data
| DeviceOptions |
Returns: Promise<null>
connect(...)
connect(data: DeviceOptions) => Promise<null>
Connects to the metawear sensor.
| Param | Type |
| ---------- | ------------------------------------------------------- |
| data
| DeviceOptions |
Returns: Promise<null>
connectSensor1(...)
connectSensor1(data: DeviceOptions) => Promise<ConnectedDevice>
Connects to the metawear sensor number 1.
| Param | Type |
| ---------- | ------------------------------------------------------- |
| data
| DeviceOptions |
Returns: Promise<ConnectedDevice>
connectSensor2(...)
connectSensor2(data: DeviceOptions) => Promise<ConnectedDevice>
Connects to the metawear sensor number 2.
| Param | Type |
| ---------- | ------------------------------------------------------- |
| data
| DeviceOptions |
Returns: Promise<ConnectedDevice>
disconnect(...)
disconnect(data: DeviceOptions) => Promise<DisconnectResult>
Disconnect metawear sensor.
| Param | Type |
| ---------- | ------------------------------------------------------- |
| data
| DeviceOptions |
Returns: Promise<DisconnectResult>
startData()
startData() => Promise<null>
Start accel and gryo data streaming and on-board logging.
Returns: Promise<null>
startAccelData(...)
startAccelData(accelData?: AccelData | undefined) => Promise<null>
Start accel data streaming and on-board logging.
Listen in JS for the logging ID with: MetawearCapacitor.addListener('accelLogID', (logID) -> { ... });
Listen in JS with: MetawearCapacitor.addListener('accelData', (accel) => { ... });
| Param | Type |
| --------------- | ----------------------------------------------- |
| accelData
| AccelData |
Returns: Promise<null>
stopAccelData()
stopAccelData() => Promise<StreamData>
Returns: Promise<StreamData>
startGyroData()
startGyroData() => Promise<null>
Start gyro data streaming and on-board logging.
Listen in JS for the logging ID with: MetawearCapacitor.addListener('gyroLogID', (logID) -> { ... });
Listen in JS for data stream with: MetawearCapacitor.addListener('gyroData', (gyro) => { ... });
Returns: Promise<null>
stopGyroData()
stopGyroData() => Promise<null>
Returns: Promise<null>
stopData()
stopData() => Promise<null>
Stop data streaming and on-board logging.
Returns: Promise<null>
downloadData()
downloadData() => Promise<null>
Downloads one of the two logs from the metawear sensor.
Listen in JS for the log data with: MetawearCapacitor.addListener('logData-ID', (logData) -> { ... }); (logData["x"], logData["y"], logData["z"] are floats.)
Listen in JS for the log progress with: MetawearCapacitor.addListener('logProgress-ID', (progress) -> { ... }); (progress["progress"] is a number between 0 and 1.)
Listen in JS for log finish with: MetawearCapacitor.addListener('logFinished-ID', () => { ... });
Returns: Promise<null>
stopLogs()
stopLogs() => Promise<null>
Stop on-board logging.
Returns: Promise<null>
checkSensorsConnections()
checkSensorsConnections() => Promise<null>
Check for the connections status of both sensors
Returns: Promise<null>
reconnectSensors()
reconnectSensors() => Promise<null>
Reconnect both sensors
Returns: Promise<null>
reconnectSensor1()
reconnectSensor1() => Promise<resultConnection>
Reconnect sensors2
Returns: Promise<resultConnection>
reconnectSensor2()
reconnectSensor2() => Promise<resultConnection>
Reconnect sensor1
Returns: Promise<resultConnection>
downloadDataSensor1()
downloadDataSensor1() => Promise<BoardData>
Download Sensor1
Returns: Promise<BoardData>
downloadDataSensor2()
downloadDataSensor2() => Promise<BoardData>
Download Sensor2
Returns: Promise<BoardData>
disconnectSensor2()
disconnectSensor2() => Promise<DisconnectResult>
Download Sensor2
Returns: Promise<DisconnectResult>
disconnectSensor1()
disconnectSensor1() => Promise<DisconnectResult>
Download Sensor2
Returns: Promise<DisconnectResult>
Interfaces
DeviceOptions
| Prop | Type |
| ---------- | ------------------- |
| freq
| number |
| name
| string |
| mac
| string |
ConnectedDevice
| Prop | Type |
| ------------- | ------------------- |
| battery
| number |
DisconnectResult
| Prop | Type |
| ------------ | -------------------- |
| result
| boolean |
AccelData
| Prop | Type |
| ---------- | ------------------- |
| time
| number |
StreamData
| Prop | Type |
| ------------- | ----------------------------------------------- |
| sensor1
| BoardData |
| sensor2
| BoardData |
BoardData
| Prop | Type |
| --------------------- | --------------------- |
| x_accel
| number[] |
| y_accel
| number[] |
| z_accel
| number[] |
| timestamp_accel
| string[] |
| x_gyro
| number[] |
| y_gyro
| number[] |
| z_gyro
| number[] |
| timestamp_gyro
| string[] |
resultConnection
| Prop | Type |
| --------------- | -------------------- |
| connected
| boolean |