Unable to find services for my device
I keep getting null for my serviceUUIDs:
id: "..."
isConnectable: null
localName: null
manufacturerData: null
mtu: 23
name: "lifepi0000"
overflowServiceUUIDs: null
rssi: null
serviceData: null
serviceUUIDs: null
solicitedServiceUUIDs: null
txPowerLevel: null
Also no services found:
BleError: Services not discovered for device ..
When I run the same check using another package react-native-ble-manager, everything seems to work fine and it finds my services. Does anyone know what wrong? Is there a specific version of react-native etc that I need to run. Thanks!
serviceUUIDs property is related to advertisement data only. To discover devices you have to call discoverAllServicesAndCharacteristicsForDevice and then you can get discovered devices by calling servicesForDevice. Hope it helps.
Thanks for the quick response, I really appreciate it, my team is working on a time sensitive project so this is great. The first output above is from running discoverAllServicesAndCharacteristicsForDevice. I'm getting that data from the promise. The second output is from discover services which I tried to run after I ran discoverAllCharacteristicsAndServicesForDevice
Can you give me a code snippet and native logs?
this.manager.connectToDevice(deviceID)
.then((device) => {
device.discoverAllServicesAndCharacteristics()
.then((results) => {
console.log(results);
this.manager.servicesForDevice(deviceID)
.then((services) => {
console.log(services);
});
});
});
Helo @ssajnani, it might be interesting to look at this repository => https://github.com/zhanguangao/react-native-ble-plx-demo . I was inspired by watching this repository, especially the method fetchServicesAndCharacteristicsForDevice
Closing due to lack of information and inactivity of the original poster.
When more data will be available—feel free to add that information and reopen this issue.
Best Regards
i am change
device.discoverAllServicesAndCharacteristicsForDevice()
to
this.manager.discoverAllServicesAndCharacteristicsForDevice(peripheralId)
and change
device.servicesForDevice()
to
this.manager.servicesForDevice(peripheralId)
and the problem is resolved
i am change
device.discoverAllServicesAndCharacteristicsForDevice()
to
this.manager.discoverAllServicesAndCharacteristicsForDevice(peripheralId)
and change
device.servicesForDevice()
to
this.manager.servicesForDevice(peripheralId)
and the problem is resolved
Hi @hidayatNgganteng !
I have the same problem.. I can scan and connect the device, but when I try to list the services I receve the same message error.
Can you show in your code how you solved this issue?
Thansks
device.discoverAllServicesAndCharacteristicsForDevice() for this thing i am getting error of Function not found
this.manager.discoverAllServicesAndCharacteristicsForDevice(peripheralId) and in this i am getting the same response as connectToDevice ( null values )