---
title: "IOServiceAddInterestNotification(_:_:_:_:_:_:)"
framework: iokit
role: symbol
role_heading: Function
path: iokit/1514866-ioserviceaddinterestnotification
---

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

Register for notification of state changes in an IOService.

## Declaration

```swift
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

Return Value A kern_return_t error code.

## Discussion

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

- [IOBSDNameMatching(_:_:_:)](iokit/1514486-iobsdnamematching.md)
- [IOConnectAddClient(_:_:)](iokit/1514609-ioconnectaddclient.md)
- [IOConnectAddRef(_:)](iokit/1514739-ioconnectaddref.md)
- [IOConnectGetService(_:_:)](iokit/1514438-ioconnectgetservice.md)
- [IOConnectMapMemory(_:_:_:_:_:_:)](iokit/1514377-ioconnectmapmemory.md)
- [IOConnectMapMemory64(_:_:_:_:_:_:)](iokit/1514862-ioconnectmapmemory64.md)
- [IOConnectRelease(_:)](iokit/1514511-ioconnectrelease.md)
- [IOConnectSetCFProperties(_:_:)](iokit/1514713-ioconnectsetcfproperties.md)
- [IOConnectSetCFProperty(_:_:_:)](iokit/1514796-ioconnectsetcfproperty.md)
- [IOConnectSetNotificationPort(_:_:_:_:)](iokit/1514541-ioconnectsetnotificationport.md)
- [IOConnectUnmapMemory(_:_:_:_:)](iokit/1514527-ioconnectunmapmemory.md)
- [IOConnectUnmapMemory64(_:_:_:_:)](iokit/1514760-ioconnectunmapmemory64.md)
- [IOCreateReceivePort(_:_:)](iokit/1514698-iocreatereceiveport.md)
- [IODispatchCalloutFromMessage(_:_:_:)](iokit/1514775-iodispatchcalloutfrommessage.md)
- [IOIteratorIsValid(_:)](iokit/1514556-ioiteratorisvalid.md)
- [IOIteratorNext(_:)](iokit/1514741-ioiteratornext.md)
- [IOIteratorReset(_:)](iokit/1514379-ioiteratorreset.md)
- [IOKitGetBusyState(_:_:)](iokit/1514460-iokitgetbusystate.md)
- [IOKitWaitQuiet(_:_:)](iokit/1514440-iokitwaitquiet.md)
- [IOMasterPort(_:_:)](iokit/1514652-iomasterport.md)
- [IONotificationPortCreate(_:)](iokit/1514480-ionotificationportcreate.md)
- [IONotificationPortDestroy(_:)](iokit/1514751-ionotificationportdestroy.md)
- [IONotificationPortGetMachPort(_:)](iokit/1514875-ionotificationportgetmachport.md)
- [IONotificationPortGetRunLoopSource(_:)](iokit/1514599-ionotificationportgetrunloopsour.md)
- [IONotificationPortSetDispatchQueue(_:_:)](iokit/1514596-ionotificationportsetdispatchque.md)
- [IOObjectConformsTo(_:_:)](iokit/1514505-ioobjectconformsto.md)
- [IOObjectCopyBundleIdentifierForClass(_:)](iokit/1514375-ioobjectcopybundleidentifierforc.md)
- [IOObjectCopyClass(_:)](iokit/1514781-ioobjectcopyclass.md)
- [IOObjectCopySuperclassForClass(_:)](iokit/1514635-ioobjectcopysuperclassforclass.md)
- [IOObjectGetClass(_:_:)](iokit/1514756-ioobjectgetclass.md)
- [IOObjectGetKernelRetainCount(_:)](iokit/1514325-ioobjectgetkernelretaincount.md)
- [IOObjectGetRetainCount(_:)](iokit/1514824-ioobjectgetretaincount.md)
- [IOObjectGetUserRetainCount(_:)](iokit/1514464-ioobjectgetuserretaincount.md)
- [IOObjectIsEqualTo(_:_:)](iokit/1514563-ioobjectisequalto.md)
- [IOObjectRelease(_:)](iokit/1514627-ioobjectrelease.md)
- [IOObjectRetain(_:)](iokit/1514769-ioobjectretain.md)
- [IORegistryCreateIterator(_:_:_:_:)](iokit/1514238-ioregistrycreateiterator.md)
- [IORegistryEntryCreateCFProperties(_:_:_:_:)](iokit/1514310-ioregistryentrycreatecfpropertie.md)
- [IORegistryEntryCreateCFProperty(_:_:_:_:)](iokit/1514293-ioregistryentrycreatecfproperty.md)
- [IORegistryEntryCreateIterator(_:_:_:_:)](iokit/1514318-ioregistryentrycreateiterator.md)
- [IORegistryEntryFromPath(_:_:)](iokit/1514802-ioregistryentryfrompath.md)
- [IORegistryEntryGetChildEntry(_:_:_:)](iokit/1514496-ioregistryentrygetchildentry.md)
- [IORegistryEntryGetChildIterator(_:_:_:)](iokit/1514703-ioregistryentrygetchilditerator.md)
- [IORegistryEntryGetLocationInPlane(_:_:_:)](iokit/1514340-ioregistryentrygetlocationinplan.md)
- [IORegistryEntryGetName(_:_:)](iokit/1514323-ioregistryentrygetname.md)
- [IORegistryEntryGetNameInPlane(_:_:_:)](iokit/1514475-ioregistryentrygetnameinplane.md)
- [IORegistryEntryGetParentEntry(_:_:_:)](iokit/1514454-ioregistryentrygetparententry.md)
- [IORegistryEntryGetParentIterator(_:_:_:)](iokit/1514366-ioregistryentrygetparentiterator.md)
- [IORegistryEntryGetPath(_:_:_:)](iokit/1514229-ioregistryentrygetpath.md)
- [IORegistryEntryGetRegistryEntryID(_:_:)](iokit/1514719-ioregistryentrygetregistryentryi.md)
- [IORegistryEntryIDMatching(_:)](iokit/1514880-ioregistryentryidmatching.md)
- [IORegistryEntryInPlane(_:_:)](iokit/1514668-ioregistryentryinplane.md)
- [IORegistryEntrySearchCFProperty(_:_:_:_:_:)](iokit/1514537-ioregistryentrysearchcfproperty.md)
- [IORegistryEntrySetCFProperties(_:_:)](iokit/1514414-ioregistryentrysetcfproperties.md)
- [IORegistryEntrySetCFProperty(_:_:_:)](iokit/1514882-ioregistryentrysetcfproperty.md)
- [IORegistryGetRootEntry(_:)](iokit/1514878-ioregistrygetrootentry.md)
- [IORegistryIteratorEnterEntry(_:)](iokit/1514822-ioregistryiteratorenterentry.md)
- [IORegistryIteratorExitEntry(_:)](iokit/1514334-ioregistryiteratorexitentry.md)
- [IOServiceAddMatchingNotification(_:_:_:_:_:_:)](iokit/1514362-ioserviceaddmatchingnotification.md)
- [IOServiceClose(_:)](iokit/1514646-ioserviceclose.md)
- [IOServiceGetBusyState(_:_:)](iokit/1514607-ioservicegetbusystate.md)
- [IOServiceGetMatchingService(_:_:)](iokit/1514535-ioservicegetmatchingservice.md)
- [IOServiceGetMatchingServices(_:_:_:)](iokit/1514494-ioservicegetmatchingservices.md)
- [IOServiceMatching(_:)](iokit/1514687-ioservicematching.md)
- [IOServiceMatchPropertyTable(_:_:_:)](iokit/1514685-ioservicematchpropertytable.md)
- [IOServiceNameMatching(_:)](iokit/1514416-ioservicenamematching.md)
- [IOServiceOpen(_:_:_:_:)](iokit/1514515-ioserviceopen.md)
- [IOServiceRequestProbe(_:_:)](iokit/1514364-ioservicerequestprobe.md)
- [IOServiceWaitQuiet(_:_:)](iokit/1514573-ioservicewaitquiet.md)
