2 Copyright (C) 2015-2018 IoT.bzh
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.
23 struct sd_bus_message;
26 extern struct jbus *create_jbus(struct sd_bus *sdbus, const char *path);
28 extern void jbus_addref(struct jbus *jbus);
29 extern void jbus_unref(struct jbus *jbus);
31 /* verbs for the clients */
32 extern int jbus_call_ss(
36 void (*onresp) (int, const char *, void *),
39 extern int jbus_call_js(
42 struct json_object *query,
43 void (*onresp) (int, const char *, void *),
46 extern int jbus_call_sj(
50 void (*onresp) (int, struct json_object *, void *),
53 extern int jbus_call_jj(
56 struct json_object *query,
57 void (*onresp) (int, struct json_object *, void *),
60 extern char *jbus_call_ss_sync(
65 extern char *jbus_call_js_sync(
68 struct json_object *query);
70 extern struct json_object *jbus_call_sj_sync(
75 extern struct json_object *jbus_call_jj_sync(
78 struct json_object *query);
80 extern int jbus_on_signal_s(
83 void (*onsignal) (const char *, void *),
86 extern int jbus_on_signal_j(
89 void (*onsignal) (struct json_object *, void *),
92 /* verbs for servers */
93 extern int jbus_reply_s(
94 struct sd_bus_message *smsg,
97 extern int jbus_reply_j(
98 struct sd_bus_message *smsg,
99 struct json_object *reply);
101 extern int jbus_reply_error_s(
102 struct sd_bus_message *smsg,
105 extern int jbus_reply_error_j(
106 struct sd_bus_message *smsg,
107 struct json_object *reply);
109 extern int jbus_add_service_s(
112 void (*oncall) (struct sd_bus_message *, const char *, void *),
115 extern int jbus_add_service_j(
118 void (*oncall) (struct sd_bus_message *, struct json_object *, void *),
121 extern int jbus_start_serving(
124 extern int jbus_send_signal_s(
127 const char *content);
129 extern int jbus_send_signal_j(
132 struct json_object *content);