Function

IOBluetoothDeviceRegisterForDisconnectNotification(_:_:_:)

Allows a client to register for device disconnect notification.

Declaration

func IOBluetoothDeviceRegisterForDisconnectNotification(_ inDevice: IOBluetoothDeviceRef!, _ callback: IOBluetoothUserNotificationCallback!, _ inRefCon: UnsafeMutableRawPointer!) -> Unmanaged<IOBluetoothUserNotificationRef>!

Parameters

callback

The callback to be called when the target's connection is destroyed

inRefCon

Client-supplied refCon to be passed to the callback.

Return Value

Returns an IOBluetoothUserNotificationRef representing the outstanding device disconnect notification. To unregister the notification, call IOBluetoothUserNotificationUnregister() with the returned IOBluetoothUserNotificationRef. If an error is encountered creating the notification, NULL is returned. The returned IOBluetoothUserNotificationRef will be valid for as long as the notification is registered. It is not necessary to retain the result. Once the notification is unregistered, it will no longer be valid.

Discussion

The given callback will be called when the target device's connection is closed..

See Also

Miscellaneous

func IOBluetoothIgnoreHIDDevice(IOBluetoothDeviceRef!)

Hints that the macOS Bluetooth software should ignore a HID device that connects up.

func IOBluetoothRemoveIgnoredHIDDevice(IOBluetoothDeviceRef!)

The counterpart to the above IOBluetoothIgnoreHIDDevice() API.