Contents

IOServiceAddInterestNotification(_:_:_:_:_:_:)

Register for notification of state changes in an IOService.

Declaration

func IOServiceAddInterestNotification(_ notifyPort: IONotificationPortRef!, _ service: io_service_t, _ interestType: UnsafePointer<CChar>!, _ callback: IOServiceInterestCallback!, _ refCon: UnsafeMutableRawPointer!, _ notification: UnsafeMutablePointer<io_object_t>!) -> kern_return_t

Parameters

  • notifyPort:

    A IONotificationPortRef object that controls how messages will be sent when the notification is fired. See IONotificationPortCreate.

  • interestType:

    A notification type from IOKitKeys.h

    kIOGeneralInterest General state changes delivered via the IOService::message API.

    kIOBusyInterest Delivered when the IOService changes its busy state to or from zero. The message argument contains the new busy state causing the notification.

  • callback:

    A callback function called when the notification fires, with messageType and messageArgument for the state change.

  • refCon:

    A reference constant for the callbacks use.

  • notification:

    An object handle is returned on success, and should be released by the caller when the notification is to be destroyed.

Return Value

A kern_return_t error code.

Discussion

IOService objects deliver notifications of their state changes to their clients via the IOService::message API, and to other interested parties including callers of this function. Message type s are defined IOKit/IOMessage.h.

See Also

Miscellaneous