4 author: José Bollo <jose.bollo@iot.bzh>
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
24 extern struct jbus *create_jbus(struct sbus *sbus, const char *path);
26 extern void jbus_addref(struct jbus *jbus);
27 extern void jbus_unref(struct jbus *jbus);
29 /* verbs for the clients */
30 extern int jbus_call_ss(
34 void (*onresp) (int, const char *, void *),
37 extern int jbus_call_js(
40 struct json_object *query,
41 void (*onresp) (int, const char *, void *),
44 extern int jbus_call_sj(
48 void (*onresp) (int, struct json_object *, void *),
51 extern int jbus_call_jj(
54 struct json_object *query,
55 void (*onresp) (int, struct json_object *, void *),
58 extern char *jbus_call_ss_sync(
63 extern char *jbus_call_js_sync(
66 struct json_object *query);
68 extern struct json_object *jbus_call_sj_sync(
73 extern struct json_object *jbus_call_jj_sync(
76 struct json_object *query);
78 extern int jbus_on_signal_s(
81 void (*onsignal) (const char *, void *),
84 extern int jbus_on_signal_j(
87 void (*onsignal) (struct json_object *, void *),
90 /* verbs for servers */
91 extern int jbus_reply_s(
95 extern int jbus_reply_j(
97 struct json_object *reply);
99 extern int jbus_reply_error_s(
100 struct sbusmsg *smsg,
103 extern int jbus_reply_error_j(
104 struct sbusmsg *smsg,
105 struct json_object *reply);
107 extern int jbus_add_service_s(
110 void (*oncall) (struct sbusmsg *, const char *, void *),
113 extern int jbus_add_service_j(
116 void (*oncall) (struct sbusmsg *, struct json_object *, void *),
119 extern int jbus_start_serving(
122 extern int jbus_send_signal_s(
125 const char *content);
127 extern int jbus_send_signal_j(
130 struct json_object *content);