Skip to content
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

bluetooth product info parsing and add picker to settings #3223

Merged
merged 6 commits into from
Mar 10, 2025

Conversation

benma
Copy link
Contributor

@benma benma commented Mar 6, 2025

No description provided.

@benma benma requested a review from NickeZ March 6, 2025 16:23
@@ -8,6 +8,11 @@
import CoreBluetooth
import Mobileserver

struct ProductInfo: Codable {
let product: String
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I changed the format to p and v. See latest simulator.py

@benma benma force-pushed the bt branch 2 times, most recently from 4bcd59b to 8e55a59 Compare March 7, 2025 19:38
Copy link
Collaborator

@NickeZ NickeZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

benma added 6 commits March 10, 2025 15:16
So the backend knows what kind of product/version the product is,
analoguous to the USB HID descriptor info.
When there are watchonly accounts, the waiting screen is not
shown. Instead, the user can connect a new device in Manage Device.

Manage accounts also shows the same screen if there are no
accounts. The assumption is that if there are no accounts, then there
is no device connected, so we might as well show the device picker
there too.
The backend identifiers the same "device" by the
identifier. Bootloader and firwmare should have different identifier
strings, as they are handled as different "devices" by the
backend. Otherwise a switch between them won't be recognized.
The device first connects. Pairing happens later when a secured
characteristic is used. We assume the device is paired when we can
read the product string, at which point the backend register the
device. Otherwise, the app would launch into the device workflows in
the UI and get overlaid with the pairing code suddenly, which looks broken.
Will generate a needless decoding error. The product value is empty if
not read yet or if the device is not in bootloader/firmware state.
If user aborts pairing, we don't want to auto-connect to this device
in the future.
@benma benma merged commit 1ab3d9e into BitBoxSwiss:master Mar 10, 2025
9 of 10 checks passed
@benma benma deleted the bt branch March 10, 2025 14:59
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.

2 participants