aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuta Doi <yuta-d@witz-inc.co.jp>2018-05-25 14:27:58 +0900
committerYuta Doi <yuta-d@witz-inc.co.jp>2018-05-28 09:10:16 +0900
commit5f05e17be59881ea450f2cc3a76a2dd0e408974f (patch)
tree045078a89e3f628cb79675d0e41ea4dd9d6eba4a
parentf7036a4eb19d89827133b6ae866eb40568bdf03e (diff)
Use afb_service_call instead of afb_service_call_sync
because initializing of WindowManager is dispatched when starting low-can service is late. Change-Id: I081aeda5dcd2a815467e6d19c51deec63d6303f4 Signed-off-by: Yuta Doi <yuta-d@witz-inc.co.jp>
-rw-r--r--src/low_can_client.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/low_can_client.cpp b/src/low_can_client.cpp
index c02a71c..e0568e5 100644
--- a/src/low_can_client.cpp
+++ b/src/low_can_client.cpp
@@ -72,12 +72,11 @@ void LowCanClient::initialize() {
HMI_DEBUG("wm:lcc", "subscribe message:%s", json_object_get_string(json_obj));
// Subscribe
- json_object *json_result = json_object_new_object();
- ret = afb_service_call_sync("low-can", "subscribe", json_obj, &json_result);
- if (0 > ret) {
- HMI_INFO("wm:lcc", "Could not subscribe to \"low-can\" :%d", ret);
- }
- HMI_DEBUG("wm:lcc", "subscribe result:%s", json_object_get_string(json_result));
+ afb_service_call("low-can", "subscribe", json_obj,
+ [](void* closure, int status, json_object *result){
+ HMI_DEBUG("wm:lcc", "subscribe result:%s", json_object_get_string(result));
+ },
+ nullptr);
}
return;