phdc: API documentation and sample code
[platform/upstream/neard.git] / doc / phdc-api.txt
1 PHDC hierarchy
2 ==============
3 Service         org.neard
4 Interface       org.neard.PHDC
5 Object path     /
6
7 Methods         void RegisterAgent(dict values)
8
9                         Register new PHDC agent.
10
11                         PHDC Manager or Agent implementations calls this
12                         method in order to register themselves against neard.
13                         PHDC Managers will be notified through their
14                         NewConnection method of new PHDC Agents connections.
15                         PHDC Agents will be nnotified through their
16                         NewConnection method when a connection to a PHDC Manager
17                         succeeded.
18
19                         Possible Errors: org.neard.Error.OutOfMemory
20                                          org.neard.Error.InvalidArguments
21                                          org.neard.Error.AlreadyExists
22
23                 void UnregisterAgent(object path, string role)
24
25                         Unregister an existing agent.
26
27                         Possible Errors: org.neard.Error.OutOfMemory
28                                          org.neard.Error.InvalidArguments
29
30
31 Fields          string  Role
32
33                         "Agent" or "Manager" (mandatory)
34
35                 object  Path
36
37                         Agent or Manager path (mandatory)
38
39                 string  ServiceName
40
41                         NFC urn to connect or to listen to
42                         (default: "urn:nfc:sn:phdc").
43
44
45 PHDC Manager hierarchy
46 ======================
47 Service         unique name
48 Interface       org.neard.PHDC.Manager
49 Object path     freely definable
50
51
52 Methods:        void NewConnection(fd agent)
53
54                         This method gets called when a PHDC Agent connects
55                         using the p2p service name. The Phdc Manager uses
56                         the given agent file descriptor to exchange data
57                         with the Agent.
58
59                 void Disconnection(fd agent, error)
60
61                         This method is called when a PHDC Agent closes the
62                         file descriptoer.
63
64                 void Release()
65
66                         This method is called when the service daemon
67                         unregisters the agent. An agent can use it to do
68                         cleanup tasks.
69                         There is no need to unregister the agent, because
70                         when this method gets called it has already been
71                         unregistered.
72
73
74 PHDC Agent hierarchy
75 ====================
76 Service         unique name
77 Interface       org.neard.PHDC.Agent
78 Object path     freely definable
79
80 Methods:        NOT YET IMPLEMENTED