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

Different Bluetooth address format per platform #75

Open
h3x4d3c1m4l opened this issue Mar 22, 2022 · 2 comments
Open

Different Bluetooth address format per platform #75

h3x4d3c1m4l opened this issue Mar 22, 2022 · 2 comments

Comments

@h3x4d3c1m4l
Copy link

Hi! I noticed Bluetooth address is a int64 (as String) on Windows, which I seem to be able to parse correctly:

import 'package:convert/convert.dart';
[...]
ByteData btAddressData = ByteData(8)..setUint64(0, int.parse(device.deviceId));
String formatted = hex.encode(btAddressData.buffer.asUint8List(2, 6));

But on Android it is already formatted as a string (like AA:BB:CC:11:22:33). Would you accept a PR to equalize this difference? If so, what would be preferred? Perhaps it could be even better to have the Bluetooth address as Uint8List in the model.

Side note: I have not yet tested this on iOS/iPadOS/macOS as I currently don't have these devices available.

@Sunbreak
Copy link
Collaborator

PRs are welcome. I could test them when available

@Sunbreak
Copy link
Collaborator

There may be more challenges than we thought: afauch/BluetoothWatcher#1

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

No branches or pull requests

2 participants