diff options
author | José Bollo <jose.bollo@iot.bzh> | 2015-12-21 17:03:28 +0100 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2015-12-21 17:03:28 +0100 |
commit | aa181a38a00903bcbf94518abfc185d3459feace (patch) | |
tree | a35d026c8f515dca2cf852ef3ceb5d8dd471767a /src/utils-jbus.h | |
parent | eab449dec6b13464db5277c54ac23fc30d896353 (diff) |
Improved version of jbus now handling signals
Change-Id: Ib4786bf8584f0955725a215a6aa6c7ca90bc7115
Diffstat (limited to 'src/utils-jbus.h')
-rw-r--r-- | src/utils-jbus.h | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/src/utils-jbus.h b/src/utils-jbus.h index 3d71282..68e9b68 100644 --- a/src/utils-jbus.h +++ b/src/utils-jbus.h @@ -24,12 +24,30 @@ extern struct jbus *create_jbus(int session, const char *path); extern void jbus_addref(struct jbus *jbus); extern void jbus_unref(struct jbus *jbus); -extern int jbus_replyj(struct jreq *jreq, const char *reply); -extern int jbus_reply(struct jreq *jreq, struct json_object *reply); -extern int jbus_add_service(struct jbus *jbus, const char *method, void (*oncall)(struct jreq *, struct json_object *)); -extern int jbus_start_serving(struct jbus *jbus); extern int jbus_read_write_dispatch(struct jbus *jbus, int toms); -extern int jbus_callj(struct jbus *jbus, const char *method, const char *query, void (*onresp)(int, struct json_object *, void *), void *data); -extern int jbus_call(struct jbus *jbus, const char *method, struct json_object *query, void (*onresp)(int, struct json_object *response, void *), void *data); +/* verbs for the clients */ +extern int jbus_call_ss(struct jbus *jbus, const char *method, const char *query, void (*onresp)(int, const char *, void *), void *data); +extern int jbus_call_js(struct jbus *jbus, const char *method, struct json_object *query, void (*onresp)(int, const char *, void *), void *data); +extern int jbus_call_sj(struct jbus *jbus, const char *method, const char *query, void (*onresp)(int, struct json_object *, void *), void *data); +extern int jbus_call_jj(struct jbus *jbus, const char *method, struct json_object *query, void (*onresp)(int, struct json_object *, void *), void *data); + +extern char *jbus_call_ss_sync(struct jbus *jbus, const char *method, const char *query); +extern char *jbus_call_js_sync(struct jbus *jbus, const char *method, struct json_object *query); +extern struct json_object *jbus_call_sj_sync(struct jbus *jbus, const char *method, const char *query); +extern struct json_object *jbus_call_jj_sync(struct jbus *jbus, const char *method, struct json_object *query); + +extern int jbus_on_signal_s(struct jbus *jbus, const char *name, void (*onsignal)(const char *)); +extern int jbus_on_signal_j(struct jbus *jbus, const char *name, void (*onsignal)(struct json_object *)); +/* verbs for servers */ +extern int jbus_reply_s(struct jreq *jreq, const char *reply); +extern int jbus_reply_j(struct jreq *jreq, struct json_object *reply); +extern int jbus_reply_error_s(struct jreq *jreq, const char *reply); +extern int jbus_reply_error_j(struct jreq *jreq, struct json_object *reply); + +extern int jbus_add_service_s(struct jbus *jbus, const char *method, void (*oncall)(struct jreq *, const char *)); +extern int jbus_add_service_j(struct jbus *jbus, const char *method, void (*oncall)(struct jreq *, struct json_object *)); +extern int jbus_start_serving(struct jbus *jbus); +extern int jbus_send_signal_s(struct jbus *jbus, const char *name, const char *content); +extern int jbus_send_signal_j(struct jbus *jbus, const char *name, struct json_object *content); |