3 title: Functions of class afb_service
5 https://git.automotivelinux.org/src/app-framework-binder/plain/docs/reference-v3/func-service.md?h=master
8 <!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/apis_services/master/app-framework-binder-developer-guides-api-services-book.yml -->
10 Functions of class **afb_service**
11 ==============================
13 All the functions of the class **afb_service** use the default api.
15 All these function are deprecated, try to use functions of class **afb_api** instead.
21 * @deprecated try to use @ref afb_api_call instead
23 * Calls the 'verb' of the 'api' with the arguments 'args' and 'verb' in the name of the binding.
24 * The result of the call is delivered to the 'callback' function with the 'callback_closure'.
26 * For convenience, the function calls 'json_object_put' for 'args'.
27 * Thus, in the case where 'args' should remain available after
28 * the function returns, the function 'json_object_get' shall be used.
30 * The 'callback' receives 5 arguments:
31 * 1. 'closure' the user defined closure pointer 'closure',
32 * 2. 'object' a JSON object returned (can be NULL)
33 * 3. 'error' a string not NULL in case of error but NULL on success
34 * 4. 'info' a string handling some info (can be NULL)
37 * @param api The api name of the method to call
38 * @param verb The verb name of the method to call
39 * @param args The arguments to pass to the method
40 * @param callback The to call on completion
41 * @param closure The closure to pass to the callback
44 * @see afb_req_subcall
45 * @see afb_req_subcall_sync
46 * @see afb_api_call_sync
48 void afb_service_call(
51 struct json_object *args,
54 struct json_object *object,
61 ## afb_service_call_sync
65 * @deprecated try to use @ref afb_api_call_sync instead
67 * Calls the 'verb' of the 'api' with the arguments 'args' and 'verb' in the name of the binding.
68 * 'result' will receive the response.
70 * For convenience, the function calls 'json_object_put' for 'args'.
71 * Thus, in the case where 'args' should remain available after
72 * the function returns, the function 'json_object_get' shall be used.
74 * @param api The api name of the method to call
75 * @param verb The verb name of the method to call
76 * @param args The arguments to pass to the method
77 * @param object Where to store the returned object - should call json_object_put on it - can be NULL
78 * @param error Where to store the copied returned error - should call free on it - can be NULL
79 * @param info Where to store the copied returned info - should call free on it - can be NULL
81 * @returns 0 in case of success or a negative value in case of error.
83 * @see afb_req_subcall
84 * @see afb_req_subcall_sync
87 int afb_service_call_sync(
90 struct json_object *args,
91 struct json_object **object,
96 ## afb_service_call_legacy
100 * @deprecated try to use @ref afb_api_call instead
102 * Calls the 'verb' of the 'api' with the arguments 'args' and 'verb'
103 * in the name of the binding.
104 * The result of the call is delivered to the 'callback' function with
105 * the 'callback_closure'.
107 * For convenience, the function calls 'json_object_put' for 'args'.
108 * Thus, in the case where 'args' should remain available after
109 * the function returns, the function 'json_object_get' shall be used.
111 * The 'callback' receives 3 arguments:
112 * 1. 'closure' the user defined closure pointer 'closure',
113 * 2. 'status' a status being 0 on success or negative when an error occurred,
114 * 2. 'result' the resulting data as a JSON object.
116 * @param api The api name of the method to call
117 * @param verb The verb name of the method to call
118 * @param args The arguments to pass to the method
119 * @param callback The to call on completion
120 * @param closure The closure to pass to the callback
122 * @see also 'afb_api_call'
123 * @see also 'afb_api_call_sync'
124 * @see also 'afb_api_call_sync_legacy'
125 * @see also 'afb_req_subcall'
126 * @see also 'afb_req_subcall_sync'
128 void afb_service_call_legacy(
131 struct json_object *args,
135 struct json_object *result,
140 ## afb_service_call_sync_legacy
144 * @deprecated try to use @ref afb_api_call_sync instead
146 * Calls the 'verb' of the 'api' with the arguments 'args' and 'verb' in the
147 * name of the binding. 'result' will receive the response.
149 * For convenience, the function calls 'json_object_put' for 'args'.
150 * Thus, in the case where 'args' should remain available after
151 * the function returns, the function 'json_object_get' shall be used.
153 * @param api The api name of the method to call
154 * @param verb The verb name of the method to call
155 * @param args The arguments to pass to the method
156 * @param result Where to store the result - should call json_object_put on it -
158 * @returns 0 in case of success or a negative value in case of error.
160 * @see also 'afb_api_call'
161 * @see also 'afb_api_call_sync'
162 * @see also 'afb_api_call_legacy'
163 * @see also 'afb_req_subcall'
164 * @see also 'afb_req_subcall_sync'
166 int afb_service_call_sync_legacy(
169 struct json_object *args,
170 struct json_object **result);