p2p: Add a user_data pointer to p2p struct
[platform/upstream/neard.git] / doc / adapter-api.txt
1 Adapter hierarchy
2 =================
3
4 Service         org.neard
5 Interface       org.neard.Adapter
6 Object path     [variable prefix]/{nfc0,nfc1,...}
7
8 Methods:        dict GetProperties()
9
10                         Returns all properties for the device. See the
11                         properties section for available properties.
12
13                         Possible Errors: org.neard.Error.DoesNotExist
14
15                 void SetProperty(string name, variant value)
16
17                         Changes the value of the specified property. Only
18                         properties that are listed a read-write are changeable.
19                         On success this will emit a PropertyChanged signal.
20
21                         Possible Errors: org.neard.Error.DoesNotExist
22                                          org.neard.Error.InvalidArguments
23
24                 void StartPollLoop(string mode)
25
26                         Starts the adapter polling loop. Depending on the mode,
27                         the adapter will start polling for targets, listening
28                         for NFC devices or both.
29                         The mode parameter can have the following values:
30                         "Initiator", "Target" or "Dual". For any other value
31                         the adapter will fall back to initiator mode.
32                         Dual mode will have the adapter alternate between target
33                         and initiator modes during the polling loop.
34
35                         This process will start emitting TagFound and
36                         PropertyChanged "Polling" signals.
37
38                         Possible errors: org.neard.Error.NotReady
39                                          org.neard.Error.Failed
40                                          org.neard.Error.NotSupported
41
42                 void StopPollLoop()
43
44                         The adapter polling loop will stop.
45
46                         Possible errors: org.neard.Error.NotReady
47                                          org.neard.Error.Failed
48                                          org.neard.Error.NotSupported
49
50                 object StartEmulation(dict attributes)
51
52                         Starts tag emulation mode.
53
54                         Adapters can only emulate one target at a time, so
55                         subsequent calls to this method will always return
56                         the same object path.
57
58                         The attributes dictionary is described by the
59                         Record properties.
60                         For example, one would add a type, a Language, an
61                         Encoding and a Representation for emulating a text
62                         NDEF record.
63
64                         Returns the object path for the emulated target.
65
66                         Possible errors: org.neard.Error.NotReady
67                                          org.neard.Error.Failed
68                                          org.neard.Error.NotSupported
69
70                 void StopEmulation()
71
72                         Stops tag emulation mode.
73
74                         Possible errors: org.neard.Error.NotReady
75                                          org.neard.Error.Failed
76                                          org.neard.Error.NotSupported
77
78
79 Signals         PropertyChanged(string name, variant value)
80
81                         This signal indicates a changed value of the given
82                         property.
83
84                 TagFound(string address, dict values)
85
86                         This signal is sent whenever an NFC tag is found,
87                         as a result of a probe response reception.
88
89                         The dictionary contains basically the same values
90                         that are returned by the GetProperties method
91                         from the org.neard.Tag interface.
92
93                 TagLost(string address)
94
95                         This signal is sent whenever the NFC tag is no longer
96                         in sight, or when it's been de-activated.
97
98
99 Properties      string Mode [readonly]
100
101                         The adapter NFC radio mode.
102
103                         Valid types are "Initiator", "Target" and "Idle"
104
105                 boolean Powered [readwrite]
106
107                         Switch an adapter on or off.
108
109                 boolean Polling [readonly]
110
111                         Indicates that the adapter is currently polling for
112                         targets. This is only valid when the adapter is in
113                         initiator mode.
114
115                 array{string} Protocols [readonly]
116
117                         The adapter supported protocols.
118                         Possible values are "Felica", "MIFARE", "Jewel",
119                         "ISO-DEP" and "NFC-DEP".
120
121                 array{object} Tags [readonly]
122
123                         The tags object paths.
124
125                 array{object} Devices [readonly]
126
127                         The devices object paths.