Dev:Nfcd

nfcd is a daemon running under the mobile user. It handles the communications between PassKit and the underlying hardware and libraries.

Core objects

 * NFDaemon
 * NFFieldDetectController
 * NFCoreTelephonyConnection
 * NFPowerManager
 * NFAbstractController
 * NFCardEmulationController
 * NFSecureElementController

Launchd plist
Where the XPC service is registered under the "com.apple.nfcd" name

Sending XPC Commands
Four XPC keys are sent for the XPC command:
 * NFMsgObject - dictionary containing values to sent to receiving objects
 * NFMsgType - uint64, sending is a 0, receiving a 1
 * NFMsgCode - uint64, "command" as described above
 * NFMsgId - uint64, undetermined

Example of XPC command to the nfcd: see https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/xpc_dictionary_set_uint64.3.html

NFDaemon methods
This function checks for an existing controller


 * [NFCardEmulationController embeddedCardEmulationController]
 * [NFCardEmulationController UICCCardEmulationController]
 * [NFSecureElementController seController]
 * [NFFieldDetectController fieldDetectController]

When it finds the appropriate controller it calls the unregister function for it.