X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=plugins%2Fsamples%2Ftic-tac-toe.c;h=31682d941eb77631548eab03ae8bb239cf2eac46;hb=459396440bf35ace1046723a8efab9a9c22629bf;hp=79aaaf5893ef5ea5c457c9f358ae13985128424c;hpb=69b098942bd6c5b54d4849564407f9d20e598c06;p=src%2Fapp-framework-binder.git diff --git a/plugins/samples/tic-tac-toe.c b/plugins/samples/tic-tac-toe.c index 79aaaf58..31682d94 100644 --- a/plugins/samples/tic-tac-toe.c +++ b/plugins/samples/tic-tac-toe.c @@ -299,7 +299,7 @@ static void changed(struct board *board, const char *reason) waiter = next; } - afb_event_sender_push(afb_daemon_get_event_sender(afbitf->daemon), reason, description); + afb_daemon_broadcast_event(afbitf->daemon, reason, description); } /* @@ -549,7 +549,6 @@ static void play(struct afb_req req) static void wait(struct afb_req req) { - int count; struct board *board; struct waiter *waiter; @@ -557,21 +556,6 @@ static void wait(struct afb_req req) board = board_of_req(req); INFO(afbitf, "method 'wait' called for boardid %d", board->id); - /* counts the waiters */ - count = 0; - waiter = board->waiters; - while (waiter != NULL) { - count++; - waiter = waiter->next; - } - - /* checks ability to wait */ - if (count + 1 >= board->use_count) { - WARNING(afbitf, "can't wait: count=%d and use_count=%d", count, board->use_count); - afb_req_fail(req, "error", "can't wait"); - return; - } - /* creates the waiter and enqueues it */ waiter = calloc(1, sizeof *waiter); waiter->req = req; @@ -586,7 +570,7 @@ static void wait(struct afb_req req) static const struct AFB_verb_desc_v1 plugin_verbs[] = { /* VERB'S NAME SESSION MANAGEMENT FUNCTION TO CALL SHORT DESCRIPTION */ { .name= "new", .session= AFB_SESSION_NONE, .callback= new, .info= "Starts a new game" }, - { .name= "play", .session= AFB_SESSION_NONE, .callback= play, .info= "Tells the server to play" }, + { .name= "play", .session= AFB_SESSION_NONE, .callback= play, .info= "Asks the server to play" }, { .name= "move", .session= AFB_SESSION_NONE, .callback= move, .info= "Tells the client move" }, { .name= "board", .session= AFB_SESSION_NONE, .callback= board, .info= "Get the current board" }, { .name= "level", .session= AFB_SESSION_NONE, .callback= level, .info= "Set the server level" },