adapter: Bypass the target layer
[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 StartPoll()
25
26                         The adapter will start polling for targets when calling
27                         this method. It is only valid when the adapter is in
28                         initiator mode.
29
30                         This process will start emitting TagFound and
31                         PropertyChanged "Polling" signals.
32
33                         Possible errors: org.neard.Error.NotReady
34                                          org.neard.Error.Failed
35                                          org.neard.Error.NotSupported
36
37                 void StopPoll()
38
39                         The adapter will stop polling for targets when calling
40                         this method. It is only available when the adapter is in
41                         initiator mode.
42
43                         Possible errors: org.neard.Error.NotReady
44                                          org.neard.Error.Failed
45                                          org.neard.Error.NotSupported
46
47                 object StartEmulation(dict attributes)
48
49                         Starts tag emulation mode.
50
51                         Adapters can only emulate one target at a time, so
52                         subsequent calls to this method will always return
53                         the same object path.
54
55                         The attributes dictionary is described by the
56                         Record properties.
57                         For example, one would add a type, a Language, an
58                         Encoding and a Representation for emulating a text
59                         NDEF record.
60
61                         Returns the object path for the emulated target.
62
63                         Possible errors: org.neard.Error.NotReady
64                                          org.neard.Error.Failed
65                                          org.neard.Error.NotSupported
66
67                 void StopEmulation()
68
69                         Stops tag emulation mode.
70
71                         Possible errors: org.neard.Error.NotReady
72                                          org.neard.Error.Failed
73                                          org.neard.Error.NotSupported
74
75                 void Publish(dict attributes)
76
77                         Creates an NDEF record from the attributes dictionary.
78                         The NDEF is then queued for publication.
79
80                         Only the first NDEF on the queue will be written to
81                         an NFC tag while all of them will be pushed on a peer
82                         to peer link.
83
84                         The attribute argument should at least contain a
85                         record type and is described by the Record properties.
86                         For example, one would add a type, a Language, an
87                         Encoding and a Representation for a text record.
88
89                         Possible Errors: org.neard.Error.PermissionDenied
90                                          org.neard.Error.InvalidArguments
91
92
93 Signals         PropertyChanged(string name, variant value)
94
95                         This signal indicates a changed value of the given
96                         property.
97
98                 TagFound(string address, dict values)
99
100                         This signal is sent whenever an NFC tag is found,
101                         as a result of a probe response reception.
102  
103                         The dictionary contains basically the same values
104                         that are returned by the GetProperties method
105                         from the org.neard.Tag interface.
106
107                 TagLost(string address)
108
109                         This signal is sent whenever the NFC tag is no longer
110                         in sight, or when it's been de-activated.
111
112
113 Properties:     string Mode [readwrite]
114
115                         The adapter mode.
116
117                         Valid types are "initiator" and "target".
118                         The default value for the adapter mode is "initiator".
119
120                 boolean Powered [readwrite]
121
122                         Switch an adapter on or off.
123
124                 boolean Polling [readonly]
125
126                         Indicates that the adapter is currently polling for targets.
127                         This is only valid when the adapter is in initiator mode.
128
129                 array{string} Protocols [readonly]
130
131                         The adapter supported protocols.
132                         Possible values are "Felica", "MIFARE", "Jewel",
133                         "ISO-DEP" and "NFC-DEP".
134
135                 array{object} Tags [readonly]
136
137                         The tags object paths.