Skip to content

Conversation

@lukipuki
Copy link
Collaborator

Summary
Call to Manager::adapters() spawns a new never-ending thread, so we have to call it just once.

Related Issues
#83

Proposed Changes

  • Use OnceCell to store Manager::adapters()

Checklist

  • Tests pass locally
  • Documentation updated if needed

@andrewdavidmackenzie
Copy link
Contributor

The API to build_ble_stream

seems to have changed, but I don't see it in this PR...

I get this build error switching to this branch

error[E0283]: type annotations needed
   --> src/device_subscription.rs:211:9
    |
211 |         utils::stream::build_ble_stream(&device.mac_address.into(), Duration::from_secs(4)).await?;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                     ---- type must be known at this point
    |         |
    |         cannot infer type of the type parameter `B` declared on the function `build_ble_stream`
    |
    = note: multiple `impl`s satisfying `_: From<btleplug::api::bdaddr::BDAddr>` found in the following crates: `btleplug`, `meshtastic`:
            - impl From<btleplug::api::bdaddr::BDAddr> for BleId;
            - impl From<btleplug::api::bdaddr::BDAddr> for u64;
    = note: required for `btleplug::api::bdaddr::BDAddr` to implement `Into<_>`
help: consider specifying the generic argument
    |
211 |         utils::stream::build_ble_stream::<&T>(&device.mac_address.into(), Duration::from_secs(4)).await?;
    |                                        ++++++

@andrewdavidmackenzie
Copy link
Contributor

Able to fix it relatively easy, but commenting in case you want to mention API change or take into account in semver version numbering

@andrewdavidmackenzie
Copy link
Contributor

It seems to fix the problem and the thread count for my app is now stable over time.
Thanks!

@lukipuki lukipuki marked this pull request as ready for review November 23, 2025 10:22
@lukipuki
Copy link
Collaborator Author

Thanks for testing!

The API was changed in this recent PR: #76
It doesn't require a mention in release notes and changelog, as this is a change of unstable API that was not yet part of a release.

Btw, we don't have a changelog for this crate, I'll create one and make the release this week.

@lukipuki lukipuki merged commit 87bf24b into main Nov 23, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants