Constructor
new Myo(dataArray)
Represents a Myo device
Parameters:
Name | Type | Description |
---|---|---|
dataArray |
Array | Myo information fields as an array |
Members
-
fwVersion :string
-
Firmware version of the Myo device (e.g. "1.1.4")
Type:
- string
-
macAddress :string
-
MAC address of the Myo device
Type:
- string
-
name :string
-
Given name of the Myo device
Type:
- string
Methods
-
equals(myo2) → {Boolean}
-
Comparison function
Parameters:
Name Type Description myo2
Myo Device to compare to Returns:
true if it's the same Myo device, false otherwise.- Type
- Boolean
-
getConnectionState(sCb, eCb)
-
Request the current connection state of the device
Parameters:
Name Type Description sCb
ConnStateCallback Success callback, which receives a MyoApi.ConnectionState representing the connection state of the device eCb
ErrorCallback Error callback -
isConnected(sCb, eCb)
-
Check if the device is currently connected
Parameters:
Name Type Description sCb
BooleanCallback Success callback, which receives a boolean representing if the device is connected eCb
ErrorCallback Error callback -
isUnlocked(sCb, eCb)
-
Request to get the current locking state of the device.
Parameters:
Name Type Description sCb
SuccessCallback Success callback, which will receive a boolean as result eCb
ErrorCallback Error callback -
lock(sCb, eCb)
-
Request to lock the device.
Parameters:
Name Type Description sCb
SuccessCallback Success callback eCb
ErrorCallback Error callback Fires:
- module:MyoApi#event:lock
-
notifyUserAction(sCb, eCb)
-
Request the device to notify the user (short vibration)
Parameters:
Name Type Description sCb
SuccessCallback Success callback eCb
ErrorCallback Error callback -
requestRssi(sCb, eCb)
-
Request RSSI (received signal strength indication). The data is received via the callback registered with MyoApi.on for the "rssi" event.
Parameters:
Name Type Description sCb
SuccessCallback Success callback eCb
ErrorCallback Error callback Fires:
- module:MyoApi#event:rssi
-
unlock(sCb, eCb)
-
Request to unlock the device.
Parameters:
Name Type Description sCb
SuccessCallback Success callback eCb
ErrorCallback Error callback Fires:
- module:MyoApi#event:unlock
-
vibrate(vibrationType, sCb, eCb)
-
Send command to vibrate this device.
Parameters:
Name Type Description vibrationType
MyoApi.VibrationType Vibration type to be requested sCb
SuccessCallback Success callback eCb
ErrorCallback Error callback