pub struct Armband(/* private fields */);
Expand description
Myo Armband
Implementations§
Source§impl Armband
impl Armband
Sourcepub fn raw_id(&self) -> usize
pub fn raw_id(&self) -> usize
Raw ID
Examples found in repository?
examples/eventlog.rs (line 34)
30 fn on_arm_synced(&mut self, event: myo::ArmSyncedEvent) -> myo::HandlerResult
31 {
32 let device = event.device();
33 println!("{} {} Arm Synced! on {:?}, +x {:?}, warm? {:?}, estimated device rotation {} rad",
34 event.timestamp(), device.raw_id(), event.arm(), event.xdirection(), event.warmup_state(), event.rotation_on_arm());
35 /// Request RSSI and Battery Level immediately.
36 device.request_rssi().unwrap();
37 device.request_battery_level().unwrap();
38 // device.set_stream_emg(true).unwrap();
39 myo::HandlerResult::Continue
40 }
41 fn on_arm_unsynced(&mut self, event: myo::ArmUnsyncedEvent) -> myo::HandlerResult
42 {
43 let device = event.device();
44 println!("{} {} Arm Unsynced!", event.timestamp(), device.raw_id());
45 device.set_stream_emg(false).unwrap();
46 myo::HandlerResult::Continue
47 }
48 /*fn on_orientation_data(&mut self, event: myo::OrientationEvent) -> myo::HandlerResult
49 {
50 println!("{} {} Orientation Update: qrot {:?} acc {:?} gyro {:?}", event.timestamp(), event.device().raw_id(),
51 event.q_orientation(), event.v_accelerometer(), event.v_gyroscope());
52 myo::HandlerResult::Continue
53 }*/
54 fn on_pose(&mut self, event: myo::PoseEvent) -> myo::HandlerResult
55 {
56 println!("{} {} Pose Update: {:?}", event.timestamp(), event.device().raw_id(), event.pose());
57 myo::HandlerResult::Continue
58 }
59 fn on_rssi_value(&mut self, event: myo::RSSIEvent) -> myo::HandlerResult
60 {
61 println!("{} {} RSSI: {}", event.timestamp(), event.device().raw_id(), event.rssi());
62 myo::HandlerResult::Continue
63 }
64 fn on_unlocked(&mut self, event: myo::UnlockedEvent) -> myo::HandlerResult
65 {
66 println!("{} {} Unlocked!", event.timestamp(), event.device().raw_id());
67 myo::HandlerResult::Continue
68 }
69 fn on_locked(&mut self, event: myo::LockedEvent) -> myo::HandlerResult
70 {
71 println!("{} {} Locked!", event.timestamp(), event.device().raw_id());
72 myo::HandlerResult::Continue
73 }
74 fn on_emg_data(&mut self, event: myo::EMGEvent) -> myo::HandlerResult
75 {
76 println!("{} {} EMG: {:?}", event.timestamp(), event.device().raw_id(), event.emgs());
77 myo::HandlerResult::Continue
78 }
79 fn on_battery_level(&mut self, event: myo::BatteryLevelEvent) -> myo::HandlerResult
80 {
81 println!("{} {} Battery Level: {}", event.timestamp(), event.device().raw_id(), event.battery_level());
82 myo::HandlerResult::Continue
83 }
84 fn on_warmup_completed(&mut self, event: myo::WarmupCompletedEvent) -> myo::HandlerResult
85 {
86 println!("{} {} Warmup Completed! {:?}", event.timestamp(), event.device().raw_id(), event.result());
87 myo::HandlerResult::Continue
88 }
pub fn vibrate(&self, vtype: VibrationType) -> Result<()>
Sourcepub fn request_rssi(&self) -> Result<()>
pub fn request_rssi(&self) -> Result<()>
Sourcepub fn request_battery_level(&self) -> Result<()>
pub fn request_battery_level(&self) -> Result<()>
Sourcepub fn set_stream_emg(&self, stream_emg_data: bool) -> Result<()>
pub fn set_stream_emg(&self, stream_emg_data: bool) -> Result<()>
pub fn lock(&self) -> Result<()>
pub fn unlock(&self, unlock_type: UnlockType) -> Result<()>
pub fn notify_user_action(&self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Armband
impl RefUnwindSafe for Armband
impl !Send for Armband
impl !Sync for Armband
impl Unpin for Armband
impl UnwindSafe for Armband
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more