summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorzheng_wenlong <wenlong_zheng@nexty-ele.com>2017-10-23 14:46:17 +0900
committerZheng Wenlong <wenlong_zheng@nexty-ele.com>2017-10-30 04:26:09 +0000
commiteabd10ffe2f9cb5c31262ad3152b037eb2286857 (patch)
treef8885ee5a8990a9fe9bdc88d03c96e48989f06dd /src
parent06a2777ce769346ba85aee9f38ccb237a2d72915 (diff)
Modify function argument from char to json
Change libhomescreen event api from char to json. Also modify samples who use this. BUG-AGL: SPEC-992 Change-Id: Id3986d413f9494019f6b175488dd73de226ba020 Signed-off-by: zheng_wenlong <wenlong_zheng@nexty-ele.com>
Diffstat (limited to 'src')
-rw-r--r--src/libhomescreen.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/libhomescreen.cpp b/src/libhomescreen.cpp
index 42ab8b1..2f3ef44 100644
--- a/src/libhomescreen.cpp
+++ b/src/libhomescreen.cpp
@@ -441,25 +441,15 @@ void LibHomeScreen::on_event(void *closure, const char *event, struct afb_wsj1_m
if (strcasecmp(event_only, LibHomeScreen::event_list[0].c_str()) == 0) {
auto i = this->handlers.find(Event_TapShortcut);
-
- struct json_object *json_application_name = json_object_object_get(json_data, "application_name");
- const char* application_name = json_object_get_string(json_application_name);
-
if ( i != this->handlers.end() ) {
- i->second(application_name);
+ i->second(json_data);
}
}
else if (strcasecmp(event_only, LibHomeScreen::event_list[1].c_str()) == 0) {
-
auto i = this->handlers.find(Event_OnScreenMessage);
-
- struct json_object *json_display_message = json_object_object_get(json_data, "display_message");
- const char* display_message = json_object_get_string(json_display_message);
-
if ( i != this->handlers.end() ) {
- i->second(display_message);
+ i->second(json_data);
}
-
}
json_object_put(ev_contents);