File tree 2 files changed +16
-10
lines changed
2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ async def main(args: argparse.Namespace):
64
64
await sc .start ()
65
65
66
66
# receive notifications for 5 seconds
67
- await asyncio .sleep (5 )
67
+ await asyncio .sleep (args . seconds )
68
68
69
69
# stop the indicate/notify
70
70
await sc .stop ()
@@ -90,6 +90,13 @@ async def main(args: argparse.Namespace):
90
90
help = "the mac address to connect to" ,
91
91
metavar = "<mac-address>" ,
92
92
)
93
+ parser .add_argument (
94
+ "--seconds" ,
95
+ default = 10 ,
96
+ help = "seconds to read data" ,
97
+ metavar = "<seconds>" ,
98
+ type = int ,
99
+ )
93
100
94
101
args = parser .parse_args ()
95
102
Original file line number Diff line number Diff line change @@ -441,16 +441,15 @@ async def setup(
441
441
# never sleep
442
442
await self .set_sleep_mode (SleepMode .NEVER_SLEEP )
443
443
# setup modes
444
- self .emg_mode = emg_mode
445
- self .imu_mode = imu_mode
446
- self .classifier_mode = classifier_mode
447
-
448
- # enforce the modes when aggregate_all
449
- if self .aggregate_all and (
450
- self .emg_mode != EMGMode .SEND_FILT or self .imu_mode in (IMUMode .NONE , IMUMode .SEND_EVENTS , IMUMode .SEND_RAW )
451
- ):
444
+ if self .aggregate_all :
445
+ # enforce the modes when aggregate_all
446
+ self .classifier_mode = ClassifierMode .DISABLED
452
447
self .emg_mode = EMGMode .SEND_FILT
453
- self .imu_mode = IMUMode .SEND_ALL
448
+ self .imu_mode = IMUMode .SEND_DATA
449
+ else :
450
+ self .classifier_mode = classifier_mode
451
+ self .emg_mode = emg_mode
452
+ self .imu_mode = imu_mode
454
453
455
454
await self .set_mode (
456
455
classifier_mode = self .classifier_mode ,
You can’t perform that action at this time.
0 commit comments