Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if let bluetoothDevice = IOBluetoothDevice(addressString: "Bluetooth Device ID")
- {
- if !bluetoothDevice.isPaired() || !bluetoothDevice.isConnected() { continue }
- // Device is connected and paired, everything works fine until here.
- if bluetoothDevice.isHandsFreeDevice
- {
- // This line will also be executed, so the device supports the HFP.
- let handsFree = IOBluetoothHandsFree(device: bluetoothDevice, delegate: self)
- // handsFree?.connect()
- // Swift.print(handsFree?.isConnected) // returns false.
- let batteryValue = handsFree?.indicator(IOBluetoothHandsFreeIndicatorBattChg)
- Swift.print(batteryValue) // Always returns zero, can't be true.
- Swift.print(handsFree?.outputVolume) // Always returns 0.5.
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement