Cannot connect to device using Service UUIDs
See original GitHub issuePrerequisites
- I am running the latest version
- I checked the documentation and found no answer
- I checked to make sure that this issue has not already been filed
Expected Behavior
BleManager.startDeviceScan should emit callback when serviceUUIDs are present on peripheral.
Current Behavior
BleManager.startDeviceScan does not emit callback when serviceUUIDs are present.
Steps to Reproduce
- Use array of one or more strings to filter peripherals scanned by service UUID.
- Callback is not fired
- Set service UUIDs to null
- Callback is fired for all peripherals
Context
Current environment:
{
"react": "16.8.3",
"react-native": "0.59.3",
"react-native-ble-plx": "1.0.3"
}
The code below demonstrates the problem:
const bleManager = new BleManager();
bleManager.onStateChange(state => {
if (state !== "PoweredOn") return
bleManager.startDeviceScan(
["053d03fd-00b0-4331-a337-f49f59777484"], // change this value to null to and all peripherals are called
null,
(error, scannedDevice) => {
if (error) console.error(error);
bleManager.connectToDevice(scannedDevice.id).then(connectedDevice => {
return connectedDevice.discoverAllServicesAndCharacteristics()
}).then(connectedDevice2 => {
return connectedDevice2.services()
}).then(services => {
console.log(services.map(x=>x.uuid));
})
}
)
})
After changing services to null, the service UUIDs are printed in console. I have tried to copy/paste the array for the services and running again, but the peripheral is still not found.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Cannot connect to device using Service UUIDs #443 - GitHub
After changing services to null, the service UUIDs are printed in console. I have tried to copy/paste the array for the services and...
Read more >BLE: Can not connect to device wit… | Apple Developer Forums
My all devices have different name and identifier, first device is working fine. For creating UUID values, I used UUID generator. var secondFirstCharacteristic ......
Read more >Connecting to a specific BLE devicetype using UUID and Name
I am getting an error when I try to connect to a specific device image. The docs have the 'type' missing - it's...
Read more >Why cant I connect to the hands free service on my device?
I tried to connect Gear S3 to hands free service of my Galaxy S6 Edge. At first i tried to get the list...
Read more >GattServiceUuids Class (Windows.Devices.Bluetooth ...
To view a list of all Bluetooth SIG-defined service UUIDs, see Bluetooth SIG-defined Service ... doesn't have a named property, you can use...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Is
053d03fd-00b0-4331-a337-f49f59777484
present in advertisement data? You can checkscannedDevice.serviceUUIDs
field to check if this UUID is visible. If not, then that’s expected behavior.I am unfortunately having a same problem. Some fields are actually missing in connectToDevice promise