feat(discovery): implement BLE scanner and advertiser - #38
Merged
Mrwicks00 merged 1 commit intoMar 9, 2026
Merged
Conversation
13 tasks
|
🎉 This issue has been marked as completed on GrantFox as part of the Official Campaign campaign! @BigNathan1's PR #144 was approved and merged by @Mrwicks00. 🏆 @BigNathan1: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (48 total points). Track your full progress on GrantFox. 👏 Great work, @BigNathan1! Keep contributing to StellarConduit. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(discovery): Implement BLE Peer Scanner and Advertiser
Closes #23
Description
This PR implements the BLE discovery layer in
src/discovery/ble.rs.Changes
BleAdvertisementPayload: 33-byte struct (32-byte pubkey + 1-byte caps). Encodes/decodes the manufacturer data payload embedded in BLE advertisements. Capability flags: bit 0 =is_relay, bit 1 =has_wifi_direct.BleScanner: Holds anArc<Mutex<PeerList>>and abroadcast::Sender<DiscoveryEvent>. The testablehandle_advertisement()method decodes the payload, callsPeerList::insert_or_update(using the advertisement RSSI assignal_strength), and broadcasts the resultingDiscoveryEventto all subscribers. Thestart()/stop()stubs hook into thebtleplugscan loop in production.BleAdvertiser: Encodes the localPeerIdentityinto aBleAdvertisementPayloadand begins advertising withSC_SERVICE_UUID. Thebuild_payload()method is testable without hardware.#[derive(Clone)]toDiscoveryEventto satisfy thebroadcast::Sender<T>bound.falseon probabilistic bloom filter membership checks.