Bug fix and authoring
[src/app-framework-main.git] / src / utils-jbus.h
1 /*
2  Copyright 2015 IoT.bzh
3
4  author: José Bollo <jose.bollo@iot.bzh>
5
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
9
10      http://www.apache.org/licenses/LICENSE-2.0
11
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.
17 */
18
19
20 struct jreq;
21 struct jbus;
22
23 extern struct jbus *create_jbus(int session, const char *path);
24 extern void jbus_addref(struct jbus *jbus);
25 extern void jbus_unref(struct jbus *jbus);
26
27 extern int jbus_replyj(struct jreq *jreq, const char *reply);
28 extern int jbus_reply(struct jreq *jreq, struct json_object *reply);
29 extern int jbus_add_service(struct jbus *jbus, const char *method, void (*oncall)(struct jreq *, struct json_object *));
30 extern int jbus_start_serving(struct jbus *jbus);
31 extern int jbus_read_write_dispatch(struct jbus *jbus, int toms);
32
33 extern int jbus_callj(struct jbus *jbus, const char *method, const char *query, void (*onresp)(int, struct json_object *, void *), void *data);
34 extern int jbus_call(struct jbus *jbus, const char *method, struct json_object *query, void (*onresp)(int, struct json_object *response, void *), void *data);
35