Function

IOBluetoothRegisterForFilteredL2CAPChannelOpenNotifications(_:_:_:_:)

Allows a client to register for L2CAP channel open notifications for certain types of L2CAP channels.

Declaration

func IOBluetoothRegisterForFilteredL2CAPChannelOpenNotifications(_ callback: IOBluetoothUserNotificationCallback!, _ inRefCon: UnsafeMutableRawPointer!, _ inPSM: BluetoothL2CAPPSM, _ inDirection: IOBluetoothUserNotificationChannelDirection) -> Unmanaged<IOBluetoothUserNotificationRef>!

Parameters

callback

The callback to be called when a new L2CAP channel is opened.

inRefCon

Client-supplied refCon to be passed to the callback.

psm

PSM to match a new L2CAP channel. If the PSM doesn't matter, 0 may be passed in.

inDirection

The desired direction of the L2CAP channel - kIOBluetoothUserNotificationChannelDirectionAny if the direction doesn't matter.

Return Value

Returns an IOBluetoothUserNotificationRef representing the outstanding L2CAP channel 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 whenever any L2CAP channel is opened.

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.