Skip to content

Add unsafe way of creating peripherals #502

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

Merged
merged 2 commits into from
Aug 20, 2020

Conversation

mikolak
Copy link
Collaborator

@mikolak mikolak commented Jul 28, 2020

Resolves #295

@mikolak mikolak requested a review from dariuszseweryn July 28, 2020 16:45
@@ -62,6 +62,16 @@ class InternalBleManager
@override
Future<void> stopPeripheralScan() => _bleLib.stopDeviceScan();

@override
Peripheral createUnsafePeripheral(String peripheralId, {String name}) {
const nameField = 'name';
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wish we had those constants described in a single place. Maybe protobuf?

@mikolak mikolak force-pushed the feature/#295-connect-without-scan branch from e8491e8 to dc98b5c Compare August 20, 2020 09:00
@VinciShark
Copy link

I test this function with:

var peripheral = bleManager.createUnsafePeripheral({MY_ID_HERE});
await peripheral.connect();
bool connected = await peripheral.isConnected();
print("!!!!" + connected.toString());

Works fine! LGTM

@mikolak mikolak merged commit 01d9603 into develop Aug 20, 2020
@mikolak mikolak deleted the feature/#295-connect-without-scan branch August 20, 2020 13:13
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.

Connect to a known peripheral without scanning
3 participants