phdc: API documentation and sample code
[platform/upstream/neard.git] / doc / agent-api.txt
1 HandoverAgent hierarchy
2 =======================
3
4 Service         unique name
5 Interface       org.neard.HandoverAgent
6 Object path     freely definable
7
8 Methods         dict RequestOOB(dict values) [experimental]
9
10                         This method gets called when the service daemon
11                         needs to get Out Of Band data from the handover
12                         agent, typically the BlueZ daemon.
13
14                         The service daemon will use this OOB data to build
15                         a Handover Request or Select message and send it to
16                         remote device.
17
18                         Values parameter is optional. It should be a dictionary
19                         where the keys are the field names and the values are
20                         the actual fields. If provided it should contain remote
21                         Out Of Band data received in Handover Request message.
22                         Those data will be stored for future use (i.e. when
23                         remote initialize pairing) and providing those will not
24                         initialize pairing.
25
26                         The return value should be a dictionary where the
27                         keys are the field names and the values are the
28                         actual fields.
29
30                         Possible Errors: org.neard.HandoverAgent.Error.InProgress
31                                          org.neard.HandoverAgent.Error.Failed
32
33                 void PushOOB(dict values) [experimental]
34
35                         This method gets called when service daemon received
36                         Handover Select message from selector and needs to pass
37                         remote Out Of Band data to agent to start handover.
38
39                         If there is no Bluetooth adapter or if it doesn't
40                         support simple pairing the agent will return an error.
41
42                         Agent shall implicitly initialize pairing if needed.
43
44                         This function returns when alternative carrier
45                         (Bluetooth) is ready to be used i.e. pairing has
46                         finished.
47
48                         Parameter should be a dictionary where the keys are the
49                         field names and the values are the actual fields.
50
51                         Possible Errors: org.neard.HandoverAgent.Error.InProgress
52                                          org.neard.HandoverAgent.Error.Failed
53
54                 void Release() [experimental]
55
56                         This method gets called when the service daemon
57                         unregisters the agent. An agent can use it to do
58                         cleanup tasks. There is no need to unregister the
59                         agent, because when this method gets called it has
60                         already been unregistered.
61
62 Fields          array{byte} EIR
63
64                         This is EIR blob as described in Bluetooth Core
65                         Specification 4.0 (Vol 3, Part C, chapter 8.1.6).
66                         Used by SSP capable devices.
67
68                 array{byte} nokia.com:bt
69
70                         This is a proprietary extension blob used by some
71                         Nokia Bluetooth 2.0 devices.
72
73                 array{byte} WSC
74
75                         This is a WiFi blob as described in WiFi Simple
76                         Configuration Technical Specification v2.0.2.1-rev4.
77                         (Annex L - Data Element Definitions)
78
79                 string State
80
81                         Carrier power state. This is a hint for handover agent
82                         about power state of carrier on remote device. Agent
83                         should also use it to inform neard about power state
84                         of its own carrier (in RequestOOB reply). It is up to
85                         agent to decide how to use this information.
86
87                         This field may be present only if nokia.com:bt or
88                         EIR field is also present.
89
90                         Possible values are "active", "inactive", "activating".
91
92
93 NDEFAgent hierarchy
94 =======================
95
96 Service         unique name
97 Interface       org.neard.NDEFAgent
98 Object path     freely definable
99
100 Methods         void GetNDEF(dict values) [experimental]
101
102                         This method gets called when the service daemon
103                         found an NDEF matching the registered type.
104
105                         The parameter is a dictionary where the keys are the
106                         field names and the values are the actual fields.
107
108                 void Release() [experimental]
109
110                         This method gets called when the service daemon
111                         unregisters the agent. An agent can use it to do
112                         cleanup tasks. There is no need to unregister the
113                         agent, because when this method gets called it has
114                         already been unregistered.
115
116 Fields          array{byte} NDEF
117
118                         This is the raw NDEF data.
119
120                 object Record
121
122                         This is a record object path.