summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzheng_wenlong <wenlong_zheng@nexty-ele.com>2017-10-23 20:31:08 +0900
committerZheng Wenlong <wenlong_zheng@nexty-ele.com>2017-10-26 05:49:52 +0000
commit117763d6555828b2765313bf5fd05e9b1a2ef042 (patch)
tree6834535d1774bd9dc6184eb418142d4f6015c5b0
parentdab24b2806aafd09acff9ee2d8a6989e5804d9ed (diff)
Change function argument from char to json in libhomescreen
With the new libhomescreen event api also change the function argument from char to json in the homescreen-2017. Related Commit: https://gerrit.automotivelinux.org/gerrit/#/c/11449/ BUG-AGL: SPEC-992 Change-Id: I9b55e6f2b5b0fbeba64fd888db5662fc173d91b1 Signed-off-by: zheng_wenlong <wenlong_zheng@nexty-ele.com>
-rw-r--r--homescreen/src/homescreenhandler.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/homescreen/src/homescreenhandler.cpp b/homescreen/src/homescreenhandler.cpp
index 6034a5a..badb91f 100644
--- a/homescreen/src/homescreenhandler.cpp
+++ b/homescreen/src/homescreenhandler.cpp
@@ -41,17 +41,17 @@ void HomescreenHandler::init(int port, const char *token)
myThis = this;
-// mp_hs->registerCallback(HomescreenHandler::onEv_static, HomescreenHandler::onRep_static);
-// mp_hs->subscribe(LibHomeScreen::event_list[0]);
-// mp_hs->subscribe(LibHomeScreen::event_list[1]);
-
mp_hs->registerCallback(nullptr, HomescreenHandler::onRep_static);
- mp_hs->set_event_handler(LibHomeScreen::Event_OnScreenMessage, [this](const char* display_message){
- qDebug("set_event_handler Event_OnScreenMessage display_message = %s", display_message);
+ mp_hs->set_event_handler(LibHomeScreen::Event_OnScreenMessage, [this](json_object *object){
+ const char *display_message = json_object_get_string(
+ json_object_object_get(object, "display_message"));
+ HMI_DEBUG("HomeScreen","set_event_handler Event_OnScreenMessage display_message = %s", display_message);
});
- mp_hs->set_event_handler(LibHomeScreen::Event_TapShortcut, [this](const char* application_name){
+ mp_hs->set_event_handler(LibHomeScreen::Event_TapShortcut, [this](json_object *object){
+ const char *application_name = json_object_get_string(
+ json_object_object_get(object, "application_name"));
if(strcmp(application_name, "Home") == 0){
emit this->homeButton();
}