X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fmain-afb-client-demo.c;h=b587748577fbc4218473cc7f00e69ac375e821b0;hb=7386e1c5090b4e76036bc212f2a2cf32920bb160;hp=f2c0826e2ed709be014dc024f20928896a50d0c4;hpb=b55f3cd48507105e85894be89557787eccfbe22f;p=src%2Fapp-framework-binder.git diff --git a/src/main-afb-client-demo.c b/src/main-afb-client-demo.c index f2c0826e..b5877485 100644 --- a/src/main-afb-client-demo.c +++ b/src/main-afb-client-demo.c @@ -55,11 +55,11 @@ static void on_wsj1_event(void *closure, const char *event, struct afb_wsj1_msg static void on_pws_hangup(void *closure); static void on_pws_reply(void *closure, void *request, struct json_object *result, const char *error, const char *info); -static void on_pws_event_create(void *closure, const char *event_name, int event_id); -static void on_pws_event_remove(void *closure, const char *event_name, int event_id); -static void on_pws_event_subscribe(void *closure, void *request, const char *event_name, int event_id); -static void on_pws_event_unsubscribe(void *closure, void *request, const char *event_name, int event_id); -static void on_pws_event_push(void *closure, const char *event_name, int event_id, struct json_object *data); +static void on_pws_event_create(void *closure, uint16_t event_id, const char *event_name); +static void on_pws_event_remove(void *closure, uint16_t event_id); +static void on_pws_event_subscribe(void *closure, void *request, uint16_t event_id); +static void on_pws_event_unsubscribe(void *closure, void *request, uint16_t event_id); +static void on_pws_event_push(void *closure, uint16_t event_id, struct json_object *data); static void on_pws_event_broadcast(void *closure, const char *event_name, struct json_object *data, const afb_proto_ws_uuid_t uuid, uint8_t hop); static void idle(); @@ -497,36 +497,36 @@ static void on_pws_reply(void *closure, void *request, struct json_object *resul dec_callcount(); } -static void on_pws_event_create(void *closure, const char *event_name, int event_id) +static void on_pws_event_create(void *closure, uint16_t event_id, const char *event_name) { printf("ON-EVENT-CREATE: [%d:%s]\n", event_id, event_name); fflush(stdout); } -static void on_pws_event_remove(void *closure, const char *event_name, int event_id) +static void on_pws_event_remove(void *closure, uint16_t event_id) { - printf("ON-EVENT-REMOVE: [%d:%s]\n", event_id, event_name); + printf("ON-EVENT-REMOVE: [%d]\n", event_id); fflush(stdout); } -static void on_pws_event_subscribe(void *closure, void *request, const char *event_name, int event_id) +static void on_pws_event_subscribe(void *closure, void *request, uint16_t event_id) { - printf("ON-EVENT-SUBSCRIBE %s: [%d:%s]\n", (char*)request, event_id, event_name); + printf("ON-EVENT-SUBSCRIBE %s: [%d]\n", (char*)request, event_id); fflush(stdout); } -static void on_pws_event_unsubscribe(void *closure, void *request, const char *event_name, int event_id) +static void on_pws_event_unsubscribe(void *closure, void *request, uint16_t event_id) { - printf("ON-EVENT-UNSUBSCRIBE %s: [%d:%s]\n", (char*)request, event_id, event_name); + printf("ON-EVENT-UNSUBSCRIBE %s: [%d]\n", (char*)request, event_id); fflush(stdout); } -static void on_pws_event_push(void *closure, const char *event_name, int event_id, struct json_object *data) +static void on_pws_event_push(void *closure, uint16_t event_id, struct json_object *data) { if (raw) - printf("ON-EVENT-PUSH: [%d:%s]\n%s\n", event_id, event_name, json_object_to_json_string_ext(data, JSON_C_TO_STRING_NOSLASHESCAPE)); + printf("ON-EVENT-PUSH: [%d]\n%s\n", event_id, json_object_to_json_string_ext(data, JSON_C_TO_STRING_NOSLASHESCAPE)); if (human) - printf("ON-EVENT-PUSH: [%d:%s]\n%s\n", event_id, event_name, json_object_to_json_string_ext(data, JSON_C_TO_STRING_PRETTY|JSON_C_TO_STRING_NOSLASHESCAPE)); + printf("ON-EVENT-PUSH: [%d]\n%s\n", event_id, json_object_to_json_string_ext(data, JSON_C_TO_STRING_PRETTY|JSON_C_TO_STRING_NOSLASHESCAPE)); fflush(stdout); } @@ -564,7 +564,7 @@ static void pws_call(const char *verb, const char *object) if (jerr != json_tokener_success) o = json_object_new_string(object); } - rc = afb_proto_ws_client_call(pws, verb, o, sessionid, key, NULL); + rc = afb_proto_ws_client_call(pws, verb, o, 0, 0, key, NULL); json_object_put(o); if (rc < 0) { fprintf(stderr, "calling %s(%s) failed: %m\n", verb, object?:"");