-
-
Notifications
You must be signed in to change notification settings - Fork 747
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 connection examples #15
Comments
Hi, you have to scan for the peripherals and then use the id of the peripheral to connect. |
So first I would call |
First you have to handle BleManagerDiscoverPeripheral event, then start the scan and you receive the peripheral finded. |
Hi Marco, I tried that. Does this code look right?
The code for |
Try this: componentDidMount() {
this.handleDiscoverPeripheral = this.handleDiscoverPeripheral.bind(this);
NativeAppEventEmitter.addListener(
'BleManagerDiscoverPeripheral',
this.handleDiscoverPeripheral
);
}
btnPress() {
BleManager.scan([], 5);
}
handleDiscoverPeripheral(data){
console.log(data);
} |
That example would be awesome for documentation example |
Could you post some more examples on how to connect to a device?
I tried using the examples from the README.md to connect my iphone to my mac using the UUID and MAC address, but none of them worked.
Thanks!
The text was updated successfully, but these errors were encountered: