Skip to content

Commit 56a23a9

Browse files
committed
bluetooth: don't register agent
from `bluer` documentation: It is not required by an application to register an agent. If an application chooses not to register an agent, the default agent is used. This is in most cases a good idea. Only applications like a pairing wizard should register their own agent. Ref: https://docs.rs/bluer/latest/bluer/struct.Session.html#method.register_agent
1 parent efca827 commit 56a23a9

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

src/bluetooth.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use crate::web::AppState;
66
use anyhow::anyhow;
77
use backon::{ExponentialBuilder, Retryable};
88
use bluer::{
9-
agent::Agent,
109
rfcomm::{Profile, ProfileHandle, Role, Stream},
1110
Adapter, Address, Device, Uuid,
1211
};
@@ -94,10 +93,6 @@ pub async fn init(
9493
adapter.set_discoverable_timeout(0).await?;
9594
}
9695

97-
// Default agent is probably needed when pairing for the first time
98-
let agent = Agent::default();
99-
let _ = session.register_agent(agent).await?;
100-
10196
// AA Wireless profile
10297
let profile = Profile {
10398
uuid: AAWG_PROFILE_UUID,

0 commit comments

Comments
 (0)