Nfcd: Difference between revisions

From iPhone Development Wiki
No edit summary
(Formatting.)
Line 1: Line 1:
nfcd is a daemon running under the ''mobile'' user. It handles the communications between Passkit and the underlying hardware and libraries.
nfcd is a daemon running under the ''mobile'' user. It handles the communications between PassKit and the underlying hardware and libraries.


The core objects in it are:
The core objects in it are:
Line 12: Line 12:
NFDaemon - (void)XPCConnection:(id) didReceiveCommand:(id)  
NFDaemon - (void)XPCConnection:(id) didReceiveCommand:(id)  


the launchd plist is:
== Launchd plist ==
{
 
<source lang="javascript">{
     EnablePressuredExit = 1;
     EnablePressuredExit = 1;
     EnableTransactions = 1;
     EnableTransactions = 1;
Line 24: Line 25:
     Program = "/usr/libexec/nfcd";
     Program = "/usr/libexec/nfcd";
     UserName = mobile;
     UserName = mobile;
}
}</source>
where the XPC service is registered under the "com.apple.nfcd" name


'''Supported XPC Commands are:'''
Where the XPC service is registered under the "com.apple.nfcd" name


;1:q_registerConnection:info:
== Supported XPC Commands ==
;2 : q_unregisterConnection:
 
;3-64 : send command to SE controller
{| class="wikitable"
;65 : q_updateSecureElementPowerState
! ID !! Command
;66 : _seIsInRestrictedMode
|-
;67 : restrictedModeChanged
| 1 || q_registerConnection:info:
;68-239 : callSEContoller
|-
;240 : setDeviceString
| 2 || q_unregisterConnection:
;241 : q_getControllerInfo
|-
;242 : q_getSecureElementInfo
| 3-64 || send command to SE controller
;243 : q_getBoosterInfo
|-
;244 : q_readBoosterRegister
| 65 || q_updateSecureElementPowerState
;245 : q_sendBoosterCommand
|-
;246 : q_triggerAssertion
| 66 || _seIsInRestrictedMode
;>247 : throw error
|-
| 67 || restrictedModeChanged
|-
| 68-239 || callSEContoller
|-
| 240 || setDeviceString
|-
| 241 || q_getControllerInfo
|-
| 242 || q_getSecureElementInfo
|-
| 243 || q_getBoosterInfo
|-
| 244 || q_readBoosterRegister
|-
| 245 || q_sendBoosterCommand
|-
| 246 || q_triggerAssertion
|-
| >247 || throw error
|}


These are formatted into a JSON list i.e.
These are formatted into a JSON list i.e.
{
 
command = 1;
<source lang="javascript">{
}
    command = 1;
}</source>

Revision as of 04:18, 25 September 2015

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

The core objects in it are:

  • NFDaemon
  • NFFieldDetectController
  • NFCoreTelephonyConnection
  • NFPowerManager
  • NFAbstractController
  • NFCardEmulationController
  • NFSecureElementController

NFDaemon - (void)XPCConnection:(id) didReceiveCommand:(id)

Launchd plist

{
    EnablePressuredExit = 1;
    EnableTransactions = 1;
    ExitTimeOut = 45;
    Label = "com.apple.nfcd";
    MachServices =     {
        "com.apple.nfcd" = 1;
    };
    ProcessType = Interactive;
    Program = "/usr/libexec/nfcd";
    UserName = mobile;
}

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

Supported XPC Commands

ID Command
1 q_registerConnection:info:
2 q_unregisterConnection:
3-64 send command to SE controller
65 q_updateSecureElementPowerState
66 _seIsInRestrictedMode
67 restrictedModeChanged
68-239 callSEContoller
240 setDeviceString
241 q_getControllerInfo
242 q_getSecureElementInfo
243 q_getBoosterInfo
244 q_readBoosterRegister
245 q_sendBoosterCommand
246 q_triggerAssertion
>247 throw error

These are formatted into a JSON list i.e.

{
    command = 1;
}