File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,12 @@ const FKM_UUID: uuid::Uuid = uuid::Uuid::from_u128(0x3ee59312_20bc_4c38_9e23_e78
66const SET_WIFI_UUID : uuid:: Uuid = uuid:: Uuid :: from_u128 ( 0xe2ed1fc5_0d2e_4c2d_a0a7_31e38431cc0c ) ;
77
88pub async fn start_bluetooth_task ( ) -> Result < ( ) > {
9+ let manager = Manager :: new ( ) . await ?;
10+ if manager. adapters ( ) . await . is_err ( ) {
11+ tracing:: error!( "No bluetooth adapter found!" ) ;
12+ return Ok ( ( ) ) ;
13+ }
14+
915 tokio:: task:: spawn ( async move {
1016 loop {
1117 if let Err ( e) = bluetooth_task ( ) . await {
@@ -21,11 +27,7 @@ pub async fn start_bluetooth_task() -> Result<()> {
2127
2228async fn bluetooth_task ( ) -> Result < ( ) > {
2329 let manager = Manager :: new ( ) . await ?;
24-
25- // silently fail bluetooth task if no bluetooth adapter found / bluez service not found
26- if manager. adapters ( ) . await . is_err ( ) {
27- return Ok ( ( ) ) ;
28- }
30+ manager. adapters ( ) . await ?;
2931
3032 let adapter = manager
3133 . adapters ( )
You can’t perform that action at this time.
0 commit comments