-
-
Notifications
You must be signed in to change notification settings - Fork 37
Add available_ble_devices() method #72
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
Conversation
Also refactored BleHandler: * added available_peripherals method, factoring out logic out of BleHandler::find_ble_radio. * added comments
It's better than a tuple
|
Need to make public the BleDevice struct, in the stream module like BleId? |
Made it public, also added |
Also add a few derives.
|
Could I request |
|
Done |
|
BleId implemented from_name(). WOuld be useful here too, I think not available? |
|
Doesn't this work? if let Some(name) = ble_device.name {
let ble_id = BleId::from_name(&name);
}We can add more convenience functions, but right now I want to focus on core functionality. I can add more in followup PRs. |
|
The implemented |
|
Were you thinking about keeping The following methods in
plus It would be cleaner for the client that discovers devices, and then connects to one of them if it could use the discovered ==== Unrelated, but I am saving the last device I connected to in a file, and re-connecting on start-up. For that I user serde of a struct containing I can understand if you don't want to derive Serialize and Deserialize on |
|
The discussion in the original PR #66 concluded that a larger BleId enum, which simulated both the current There'll be users wanting to refer to devices using a MAC address and using a name. This is common for meshtastic tooling, e.g. We could add a convenience function taking in |
|
I think we can:
I will do this in a followup. |
|
I think that's fine. Either that or use only |
|
The trouble I am having is impedence matching:
I think my only way out is to:
So, either I:
|
|
I'd like to merge this PR today. I'll think about making usability better, including
However, these will be in future PRs. |
|
Ok. I need the serialization one to be able to switch to main branch in my
app, so will watch for it.
Others are good ones I'll use when available
…On Sun, Nov 2, 2025, 12:30 PM Lukáš Poláček ***@***.***> wrote:
*lukipuki* left a comment (meshtastic/rust#72)
<#72 (comment)>
I'd like to merge this PR today.
I'll think about making usability better, including
- easier calling of build_ble_stream() after available_ble_devices(),
e.g. by making available_ble_devices() accept more types
- serialization/deserialization
- using available_ble_devices() in the BLE example
- ... any other
However, these will be in future PRs.
—
Reply to this email directly, view it on GitHub
<#72 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABKF4LC6WU34ROXCWOALXHT32XTLRAVCNFSM6AAAAACKRHYL2OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTINZXHA4DINRTGA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Summary
The
available_ble_devices()is requested by many users to detect BLE devices running Meshtastic.Also refactored
BleHandler:BleHandler::find_ble_radio.Related Issues
#32
Checklist