-
-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add clear_peripherals method to adapter #382
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,6 +101,12 @@ impl Central for Adapter { | |
)) | ||
} | ||
|
||
async fn clear_peripherals(&self) -> Result<()> { | ||
Err(Error::NotSupported( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm worried that this will result in people writing programs that crash on Linux as they only tested it on other platforms. What do you think about this just being a silent no-op on Linux? Not being able to clear the peripheral list shouldn't be a big issue in most cases I can think of. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That sounds good, I'll change it. It may be possible to clear the bluez list, but the bluez-async lib doesn't seem to currently support it. |
||
"Can't clear peripheral list on this platform".to_string(), | ||
)) | ||
} | ||
|
||
async fn adapter_info(&self) -> Result<String> { | ||
let adapter_info = self.session.get_adapter_info(&self.adapter).await?; | ||
Ok(format!("{} ({})", adapter_info.id, adapter_info.modalias)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can see there's no need for this to be async.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is best to keep it async, so that if a new platform (or even a linux solution later) needs it to be async we don't have to break the API. What do you think?