Repository: incubator-mynewt-core Updated Branches: refs/heads/develop a0ba34869 -> 7131b026f
oic; no need for timed_events pseudo-task anymore. Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/7b47dc1e Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/7b47dc1e Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/7b47dc1e Branch: refs/heads/develop Commit: 7b47dc1e6627201c9b22cb860e82ca60cdd1302c Parents: 3ff2428 Author: Marko Kiiskila <ma...@runtime.io> Authored: Tue Nov 15 20:27:15 2016 -0800 Committer: Marko Kiiskila <ma...@runtime.io> Committed: Mon Nov 21 17:15:47 2016 -0800 ---------------------------------------------------------------------- net/oic/src/api/oc_ri.c | 55 -------------------------------------------- 1 file changed, 55 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/7b47dc1e/net/oic/src/api/oc_ri.c ---------------------------------------------------------------------- diff --git a/net/oic/src/api/oc_ri.c b/net/oic/src/api/oc_ri.c index 2ae8a61..7d08b82 100644 --- a/net/oic/src/api/oc_ri.c +++ b/net/oic/src/api/oc_ri.c @@ -59,13 +59,6 @@ OC_LIST(client_cbs); OC_MEMB(client_cbs_s, oc_client_cb_t, MAX_NUM_CONCURRENT_REQUESTS); #endif /* OC_CLIENT */ -OC_LIST(timed_callbacks); -OC_MEMB(event_callbacks_s, oc_event_callback_t, NUM_OC_CORE_RESOURCES + - MAX_APP_RESOURCES + - MAX_NUM_CONCURRENT_REQUESTS); - -OC_PROCESS(timed_callback_events, "OC timed callbacks"); - // TODO: Define and use a complete set of error codes. int oc_stack_errno; @@ -200,7 +193,6 @@ start_processes(void) { allocate_events(); oc_etimer_init(); - oc_process_start(&timed_callback_events, NULL); oc_process_start(&coap_engine, NULL); oc_process_start(&message_buffer_handler, NULL); @@ -215,7 +207,6 @@ static void stop_processes(void) { oc_etimer_deinit(); - oc_process_exit(&timed_callback_events); oc_process_exit(&coap_engine); #ifdef OC_SECURITY @@ -256,7 +247,6 @@ oc_ri_init(void) oc_list_init(client_cbs); #endif - oc_list_init(timed_callbacks); start_processes(); oc_create_discovery_resource(); } @@ -309,39 +299,6 @@ oc_ri_add_resource(oc_resource_t *resource) } #endif /* OC_SERVER */ -static void -poll_event_callback_timers(oc_list_t list, struct oc_memb *cb_pool) -{ - oc_event_callback_t *event_cb = (oc_event_callback_t *)oc_list_head(list), - *next; - - while (event_cb != NULL) { - next = event_cb->next; - - if (oc_etimer_expired(&event_cb->timer)) { - if (event_cb->callback(event_cb->data) == DONE) { - oc_list_remove(list, event_cb); - oc_memb_free(cb_pool, event_cb); - } else { - OC_PROCESS_CONTEXT_BEGIN(&timed_callback_events); - oc_etimer_restart(&event_cb->timer); - OC_PROCESS_CONTEXT_END(&timed_callback_events); - } - } - - event_cb = next; - } -} - -static void -check_event_callbacks(void) -{ -#ifdef OC_SERVER - poll_event_callback_timers(observe_callbacks, &event_callbacks_s); -#endif /* OC_SERVER */ - poll_event_callback_timers(timed_callbacks, &event_callbacks_s); -} - #ifdef OC_SERVER static void @@ -934,18 +891,6 @@ oc_ri_alloc_client_cb(const char *uri, oc_server_handle_t *server, } #endif /* OC_CLIENT */ -OC_PROCESS_THREAD(timed_callback_events, ev, data) -{ - OC_PROCESS_BEGIN(); - while (1) { - OC_PROCESS_YIELD(); - if (ev == OC_PROCESS_EVENT_TIMER) { - check_event_callbacks(); - } - } - OC_PROCESS_END(); -} - // TODO: // resource collections // if method accepted by interface selection