Newbie to all things CoreBlooth here. I have successfully written a small app to connect to a Wahoo Blue HR heart rate monitor and retrieve the bpm for my heart rate etc. I used the tutorial below but rewrote the code into swift.
Link to tutorial
I am now trying to write a simple app to retrieve the Blood Pressure readings from a Bluetooth LE BP reader I have. The model in question is an iHealth BP5.
When I scan for this device using the following code I get nothing.
func centralManagerDidUpdateState(central: CBCentralManager!) {
if central.state == CBCentralManagerState.PoweredOff {
println("CoreBluetooth BLE hardware is powered off")
}
else if central.state == CBCentralManagerState.PoweredOn {
println("CoreBluetooth BLE hardware is powered on and ready")
let IHEALTHBP5_BP_DEVICE_INFO_SERVICE_UUID = CBUUID(string:"1810")
let services = [IHEALTHBP5_BP_DEVICE_INFO_SERVICE_UUID]
centralManager!.scanForPeripheralsWithServices(services, options: nil)
}
}
I have obviously changed the service UUID to a BP monitor and checked using an iPad running LightBlue and starting a blood pressure service. It works fine with the iPad simulating a BP service but not the BP5 device itself?
I have been reading something about manufacturers being able to hide devices? Could this be what is happening.
I have noticed that the BP5 device has to actually be 'Paired' through the iOS Bluetooth settings to work with the official app whereas the heart rate monitor did not. Does this suggest the heart rate monitor broadcasts to anyone but the BP5 has a more secure connection type?
Apologies if the terminology is off but I am new to the bluetooth world.
Any help or guidance appreciated.
regards
Olly
PS After checking the device was 'connected' in the bluetooth settings app and by the bluetooth light on the device moving from flashing to solid, I used the following method but this returned a result of zero.
let connectedPeripherals = centralManager!.retrieveConnectedPeripheralsWithServices(services)
println("Number of Connected Devices : \(connectedPeripherals.count)")