BluetoothKit
BluetoothKit copied to clipboard
If appoint service uuid, it could't find real devices.
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.
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.
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 Thanks, but it seems to have no relationship...
@pangpingfei Actually I manage to discover my device using this lib in way described above.
@pangpingfei which service UUID are you assigning?
@rhummelmose "05216AFE-02B0-B11E-3B86-60002A5D5C51"
Why can not BKCentral find nearby Bluetooth devices?
Probably because they are using a different identifier.
@rhummelmose How to solve this problem?
@pangpingfei how you solve this prolem?