1 Functions of class **afb_service**
2 ==============================
4 All the functions of the class **afb_daemon** use the default api.
6 All these function are deprecated, try to use functions of class **afb_api** instead.
12 * @deprecated try to use @ref afb_api_call instead
14 * Calls the 'verb' of the 'api' with the arguments 'args' and 'verb' in the name of the binding.
15 * The result of the call is delivered to the 'callback' function with the 'callback_closure'.
17 * For convenience, the function calls 'json_object_put' for 'args'.
18 * Thus, in the case where 'args' should remain available after
19 * the function returns, the function 'json_object_get' shall be used.
21 * The 'callback' receives 5 arguments:
22 * 1. 'closure' the user defined closure pointer 'closure',
23 * 2. 'object' a JSON object returned (can be NULL)
24 * 3. 'error' a string not NULL in case of error but NULL on success
25 * 4. 'info' a string handling some info (can be NULL)
28 * @param api The api name of the method to call
29 * @param verb The verb name of the method to call
30 * @param args The arguments to pass to the method
31 * @param callback The to call on completion
32 * @param closure The closure to pass to the callback
35 * @see afb_req_subcall
36 * @see afb_req_subcall_sync
37 * @see afb_api_call_sync
39 void afb_service_call(
42 struct json_object *args,
45 struct json_object *object,
52 ## afb_service_call_sync
56 * @deprecated try to use @ref afb_api_call_sync instead
58 * Calls the 'verb' of the 'api' with the arguments 'args' and 'verb' in the name of the binding.
59 * 'result' will receive the response.
61 * For convenience, the function calls 'json_object_put' for 'args'.
62 * Thus, in the case where 'args' should remain available after
63 * the function returns, the function 'json_object_get' shall be used.
65 * @param api The api name of the method to call
66 * @param verb The verb name of the method to call
67 * @param args The arguments to pass to the method
68 * @param object Where to store the returned object - should call json_object_put on it - can be NULL
69 * @param error Where to store the copied returned error - should call free on it - can be NULL
70 * @param info Where to store the copied returned info - should call free on it - can be NULL
72 * @returns 0 in case of success or a negative value in case of error.
74 * @see afb_req_subcall
75 * @see afb_req_subcall_sync
78 int afb_service_call_sync(
81 struct json_object *args,
82 struct json_object **object,
87 ## afb_service_call_legacy
91 * @deprecated try to use @ref afb_api_call instead
93 * Calls the 'verb' of the 'api' with the arguments 'args' and 'verb'
94 * in the name of the binding.
95 * The result of the call is delivered to the 'callback' function with
96 * the 'callback_closure'.
98 * For convenience, the function calls 'json_object_put' for 'args'.
99 * Thus, in the case where 'args' should remain available after
100 * the function returns, the function 'json_object_get' shall be used.
102 * The 'callback' receives 3 arguments:
103 * 1. 'closure' the user defined closure pointer 'closure',
104 * 2. 'status' a status being 0 on success or negative when an error occurred,
105 * 2. 'result' the resulting data as a JSON object.
107 * @param api The api name of the method to call
108 * @param verb The verb name of the method to call
109 * @param args The arguments to pass to the method
110 * @param callback The to call on completion
111 * @param closure The closure to pass to the callback
113 * @see also 'afb_api_call'
114 * @see also 'afb_api_call_sync'
115 * @see also 'afb_api_call_sync_legacy'
116 * @see also 'afb_req_subcall'
117 * @see also 'afb_req_subcall_sync'
119 void afb_service_call_legacy(
122 struct json_object *args,
126 struct json_object *result,
131 ## afb_service_call_sync_legacy
135 * @deprecated try to use @ref afb_api_call_sync instead
137 * Calls the 'verb' of the 'api' with the arguments 'args' and 'verb' in the
138 * name of the binding. 'result' will receive the response.
140 * For convenience, the function calls 'json_object_put' for 'args'.
141 * Thus, in the case where 'args' should remain available after
142 * the function returns, the function 'json_object_get' shall be used.
144 * @param api The api name of the method to call
145 * @param verb The verb name of the method to call
146 * @param args The arguments to pass to the method
147 * @param result Where to store the result - should call json_object_put on it -
149 * @returns 0 in case of success or a negative value in case of error.
151 * @see also 'afb_api_call'
152 * @see also 'afb_api_call_sync'
153 * @see also 'afb_api_call_legacy'
154 * @see also 'afb_req_subcall'
155 * @see also 'afb_req_subcall_sync'
157 int afb_service_call_sync_legacy(
160 struct json_object *args,
161 struct json_object **result);