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-25 17:13:24 +0900
commite0e3fa11d1c13f6ed41a2cbc1cf96796a98f8e9a (patch)
tree2e69f22ba19fbefdc965a536a3458d826dd90723
parented980b8cbb972accac00107922bea1dca0678d2a (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;