Myo SDK – 0.9.0
myo::DeviceListener Class Reference

A DeviceListener receives events about a Myo. More...

#include <DeviceListener.hpp>

Public Member Functions

virtual void onPair (Myo *myo, uint64_t timestamp, FirmwareVersion firmwareVersion)
 Called when a Myo has been paired. More...
 
virtual void onUnpair (Myo *myo, uint64_t timestamp)
 Called when a Myo has been unpaired. More...
 
virtual void onConnect (Myo *myo, uint64_t timestamp, FirmwareVersion firmwareVersion)
 Called when a paired Myo has been connected. More...
 
virtual void onDisconnect (Myo *myo, uint64_t timestamp)
 Called when a paired Myo has been disconnected. More...
 
virtual void onArmSync (Myo *myo, uint64_t timestamp, Arm arm, XDirection xDirection, float rotation, WarmupState warmupState)
 Called when a paired Myo recognizes that it is on an arm. More...
 
virtual void onArmUnsync (Myo *myo, uint64_t timestamp)
 Called when a paired Myo is moved or removed from the arm. More...
 
virtual void onUnlock (Myo *myo, uint64_t timestamp)
 Called when a paired Myo becomes unlocked. More...
 
virtual void onLock (Myo *myo, uint64_t timestamp)
 Called when a paired Myo becomes locked. More...
 
virtual void onPose (Myo *myo, uint64_t timestamp, Pose pose)
 Called when a paired Myo has provided a new pose. More...
 
virtual void onOrientationData (Myo *myo, uint64_t timestamp, const Quaternion< float > &rotation)
 Called when a paired Myo has provided new orientation data. More...
 
virtual void onAccelerometerData (Myo *myo, uint64_t timestamp, const Vector3< float > &accel)
 Called when a paired Myo has provided new accelerometer data in units of g. More...
 
virtual void onGyroscopeData (Myo *myo, uint64_t timestamp, const Vector3< float > &gyro)
 Called when a paired Myo has provided new gyroscope data in units of deg/s. More...
 
virtual void onRssi (Myo *myo, uint64_t timestamp, int8_t rssi)
 Called when a paired Myo has provided a new RSSI value. More...
 
virtual void onBatteryLevelReceived (myo::Myo *myo, uint64_t timestamp, uint8_t level)
 Called when a paired Myo receives an battery level update. More...
 
virtual void onEmgData (myo::Myo *myo, uint64_t timestamp, const int8_t *emg)
 Called when a paired Myo has provided new EMG data. More...
 
virtual void onWarmupCompleted (myo::Myo *myo, uint64_t timestamp, WarmupResult warmupResult)
 Called when the warmup period for a Myo has completed. More...
 

Detailed Description

A DeviceListener receives events about a Myo.

See also
Hub::addListener()
Examples:
emg-data-sample.cpp, hello-myo.cpp, and multiple-myos.cpp.

Member Function Documentation

virtual void myo::DeviceListener::onAccelerometerData ( Myo myo,
uint64_t  timestamp,
const Vector3< float > &  accel 
)
inlinevirtual

Called when a paired Myo has provided new accelerometer data in units of g.

Parameters
myoThe Myo for this event.
timestampThe timestamp of when the event is received by the SDK. Timestamps are 64 bit unsigned integers that correspond to a number of microseconds since some (unspecified) period in time. Timestamps are monotonically non-decreasing.
accelThe accelerometer data of myo, in units of g.
virtual void myo::DeviceListener::onArmSync ( Myo myo,
uint64_t  timestamp,
Arm  arm,
XDirection  xDirection,
float  rotation,
WarmupState  warmupState 
)
inlinevirtual

Called when a paired Myo recognizes that it is on an arm.

Parameters
myoThe Myo for this event.
timestampThe timestamp of when the event is received by the SDK. Timestamps are 64 bit unsigned integers that correspond to a number of microseconds since some (unspecified) period in time. Timestamps are monotonically non-decreasing.
armThe identified Arm of myo.
xDirectionThe identified XDirection of myo.
rotationThe estimated rotation of Myo on the user's arm after a sync.
warmupStateThe warmup state of myo. If warmupState is equal to WarmupState::warmupStateCold, onWarmupCompleted() will be called when the warmup period has completed.
Examples:
hello-myo.cpp.
virtual void myo::DeviceListener::onArmUnsync ( Myo myo,
uint64_t  timestamp 
)
inlinevirtual

Called when a paired Myo is moved or removed from the arm.

Parameters
myoThe Myo for this event.
timestampThe timestamp of when the event is received by the SDK. Timestamps are 64 bit unsigned integers that correspond to a number of microseconds since some (unspecified) period in time. Timestamps are monotonically non-decreasing.
Examples:
hello-myo.cpp.
virtual void myo::DeviceListener::onBatteryLevelReceived ( myo::Myo myo,
uint64_t  timestamp,
uint8_t  level 
)
inlinevirtual

Called when a paired Myo receives an battery level update.

Updates occur when the battery level changes and when the battery level is explicitly requested.

Parameters
myoThe Myo for this event.
timestampThe timestamp of when the event is received by the SDK. Timestamps are 64 bit unsigned integers that correspond to a number of microseconds since some (unspecified) period in time. Timestamps are monotonically non-decreasing.
levelbattery level reported by the myo the value is a number from 0 to 100 representing the percentage of battery life remaining.
virtual void myo::DeviceListener::onConnect ( Myo myo,
uint64_t  timestamp,
FirmwareVersion  firmwareVersion 
)
inlinevirtual

Called when a paired Myo has been connected.

Parameters
myoThe Myo for this event.
timestampThe timestamp of when the event is received by the SDK. Timestamps are 64 bit unsigned integers that correspond to a number of microseconds since some (unspecified) period in time. Timestamps are monotonically non-decreasing.
firmwareVersionThe firmware version of myo.
Examples:
multiple-myos.cpp.
virtual void myo::DeviceListener::onDisconnect ( Myo myo,
uint64_t  timestamp 
)
inlinevirtual

Called when a paired Myo has been disconnected.

Parameters
myoThe Myo for this event.
timestampThe timestamp of when the event is received by the SDK. Timestamps are 64 bit unsigned integers that correspond to a number of microseconds since some (unspecified) period in time. Timestamps are monotonically non-decreasing.
Examples:
multiple-myos.cpp.
virtual void myo::DeviceListener::onEmgData ( myo::Myo myo,
uint64_t  timestamp,
const int8_t *  emg 
)
inlinevirtual

Called when a paired Myo has provided new EMG data.

Parameters
myoThe Myo for this event.
timestampThe timestamp of when the event is received by the SDK. Timestamps are 64 bit unsigned integers that correspond to a number of microseconds since some (unspecified) period in time. Timestamps are monotonically non-decreasing.
emgAn array of 8 elements, each corresponding to one sensor.
Examples:
emg-data-sample.cpp.
virtual void myo::DeviceListener::onGyroscopeData ( Myo myo,
uint64_t  timestamp,
const Vector3< float > &  gyro 
)
inlinevirtual

Called when a paired Myo has provided new gyroscope data in units of deg/s.

Parameters
myoThe Myo for this event.
timestampThe timestamp of when the event is received by the SDK. Timestamps are 64 bit unsigned integers that correspond to a number of microseconds since some (unspecified) period in time. Timestamps are monotonically non-decreasing.
gyroThe gyroscope data of myo, in units of deg/s.
virtual void myo::DeviceListener::onLock ( Myo myo,
uint64_t  timestamp 
)
inlinevirtual

Called when a paired Myo becomes locked.

Parameters
myoThe Myo for this event.
timestampThe timestamp of when the event is received by the SDK. Timestamps are 64 bit unsigned integers that correspond to a number of microseconds since some (unspecified) period in time. Timestamps are monotonically non-decreasing.
Examples:
hello-myo.cpp.
virtual void myo::DeviceListener::onOrientationData ( Myo myo,
uint64_t  timestamp,
const Quaternion< float > &  rotation 
)
inlinevirtual

Called when a paired Myo has provided new orientation data.

Parameters
myoThe Myo for this event.
timestampThe timestamp of when the event is received by the SDK. Timestamps are 64 bit unsigned integers that correspond to a number of microseconds since some (unspecified) period in time. Timestamps are monotonically non-decreasing.
rotationThe orientation data of myo, as a Quaternion.
Examples:
hello-myo.cpp.
virtual void myo::DeviceListener::onPair ( Myo myo,
uint64_t  timestamp,
FirmwareVersion  firmwareVersion 
)
inlinevirtual

Called when a Myo has been paired.

Parameters
myoThe Myo for this event.
timestampThe timestamp of when the event is received by the SDK. Timestamps are 64 bit unsigned integers that correspond to a number of microseconds since some (unspecified) period in time. Timestamps are monotonically non-decreasing.
firmwareVersionThe firmware version of myo.
Examples:
multiple-myos.cpp.
virtual void myo::DeviceListener::onPose ( Myo myo,
uint64_t  timestamp,
Pose  pose 
)
inlinevirtual

Called when a paired Myo has provided a new pose.

Parameters
myoThe Myo for this event.
timestampThe timestamp of when the event is received by the SDK. Timestamps are 64 bit unsigned integers that correspond to a number of microseconds since some (unspecified) period in time. Timestamps are monotonically non-decreasing.
poseThe identified Pose of myo.
Examples:
hello-myo.cpp, and multiple-myos.cpp.
virtual void myo::DeviceListener::onRssi ( Myo myo,
uint64_t  timestamp,
int8_t  rssi 
)
inlinevirtual

Called when a paired Myo has provided a new RSSI value.

Parameters
myoThe Myo for this event.
timestampThe timestamp of when the event is received by the SDK. Timestamps are 64 bit unsigned integers that correspond to a number of microseconds since some (unspecified) period in time. Timestamps are monotonically non-decreasing.
rssiThe RSSI (received signal strength indication) of myo.
See also
Myo::requestRssi() to request an RSSI value from the Myo.
virtual void myo::DeviceListener::onUnlock ( Myo myo,
uint64_t  timestamp 
)
inlinevirtual

Called when a paired Myo becomes unlocked.

Parameters
myoThe Myo for this event.
timestampThe timestamp of when the event is received by the SDK. Timestamps are 64 bit unsigned integers that correspond to a number of microseconds since some (unspecified) period in time. Timestamps are monotonically non-decreasing.
Examples:
hello-myo.cpp.
virtual void myo::DeviceListener::onUnpair ( Myo myo,
uint64_t  timestamp 
)
inlinevirtual

Called when a Myo has been unpaired.

Parameters
myoThe Myo for this event.
timestampThe timestamp of when the event is received by the SDK. Timestamps are 64 bit unsigned integers that correspond to a number of microseconds since some (unspecified) period in time. Timestamps are monotonically non-decreasing.
Examples:
emg-data-sample.cpp, and hello-myo.cpp.
virtual void myo::DeviceListener::onWarmupCompleted ( myo::Myo myo,
uint64_t  timestamp,
WarmupResult  warmupResult 
)
inlinevirtual

Called when the warmup period for a Myo has completed.

Parameters
myoThe Myo for this event.
timestampThe timestamp of when the event is received by the SDK. Timestamps are 64 bit unsigned integers that correspond to a number of microseconds since some (unspecified) period in time. Timestamps are monotonically non-decreasing.
warmupResultThe warmup result of myo.

The documentation for this class was generated from the following file: