BluetoothKit icon indicating copy to clipboard operation
BluetoothKit copied to clipboard

If appoint service uuid, it could't find real devices.

Open pangpingfei opened this issue 8 years ago • 10 comments

Use "centralManager.scanForPeripheralsWithServices(nil, options: nil)", can discovery all device, but use "centralManager.scanForPeripheralsWithServices(configuration.serviceUUIDs, options: nil)", nothing.

This should be the bug of the official.

pangpingfei avatar Jun 16 '16 02:06 pangpingfei

It will probably take me a month before I get time to look at this. Please provide a PR if you're able to fix the issue.

rhummelmose avatar Jun 20 '16 06:06 rhummelmose

Just make sure your peripheral do boardcasting corresponding service, for example:

let dataServiceUUID = NSUUID(UUIDString: Config.sharedInstance.serviceUUID)!
let characteristicUUID = NSUUID(UUIDString: Config.sharedInstance.infoCharacteristicUUID)!
let config = BKPeripheralConfiguration(dataServiceUUID: dataServiceUUID, dataServiceCharacteristicUUID: characteristicUUID)

try peripheral.startWithConfiguration(config)

If you are not using this lib for advertising , make sure you have this serviceId in CBAdvertisementDataServiceUUIDsKey.

Nick-The-Uncharted avatar Jun 21 '16 08:06 Nick-The-Uncharted

@Nick-The-Uncharted Thanks, but it seems to have no relationship...

pangpingfei avatar Jun 21 '16 10:06 pangpingfei

@pangpingfei Actually I manage to discover my device using this lib in way described above.

Nick-The-Uncharted avatar Jun 21 '16 10:06 Nick-The-Uncharted

@pangpingfei which service UUID are you assigning?

rhummelmose avatar Jun 21 '16 20:06 rhummelmose

@rhummelmose "05216AFE-02B0-B11E-3B86-60002A5D5C51"

pangpingfei avatar Jun 26 '16 08:06 pangpingfei

Why can not BKCentral find nearby Bluetooth devices?

iCodist avatar Jan 09 '17 10:01 iCodist

Probably because they are using a different identifier.

rhummelmose avatar Jan 09 '17 10:01 rhummelmose

@rhummelmose How to solve this problem?

iCodist avatar Jan 09 '17 11:01 iCodist

@pangpingfei how you solve this prolem?

LazyyNguyen avatar Oct 04 '23 03:10 LazyyNguyen