aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-06-01 00:24:18 +0900
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-06-01 00:24:18 +0900
commit962293365db4ea2e11878c205e452844827338ab (patch)
tree6bd99b75610d5741b55d2e583ff5b3e4edb4072c /src
parentaf1b212d5af5b22051f1cd54028eb8f7e6a2297b (diff)
Modify subscribe
Change-Id: I383a89db82e7a3cdfb95ae4128de05c64ae8adf3 Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
Diffstat (limited to 'src')
-rw-r--r--src/wm-client.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/wm-client.cpp b/src/wm-client.cpp
index 2d440e6..380c841 100644
--- a/src/wm-client.cpp
+++ b/src/wm-client.cpp
@@ -140,9 +140,14 @@ bool WMClient::removeRole(const string &role)
bool WMClient::subscribe(afb_req req, const string &evname)
{
+ if(evname != key_err){
+ HMI_DEBUG("wm", "error is only enabeled for now");
+ return false;
+ }
int ret = afb_req_subscribe(req, event_list[evname]);
if (ret)
{
+ HMI_DEBUG("wm", "Failed to subscribe %s", evname.c_str());
return false;
}
return true;
@@ -150,6 +155,10 @@ bool WMClient::subscribe(afb_req req, const string &evname)
void WMClient::emitError(WM_CLIENT_ERROR_EVENT ev)
{
+ if (!afb_event_is_valid(this->event_list[key_err])){
+ HMI_ERROR("wm", "event err is not valid");
+ return;
+ }
json_object *j = json_object_new_object();
json_object_object_add(j, key_err, json_object_new_int(ev));
json_object_object_add(j, key_err_desc, json_object_new_string(error_description[ev].c_str()));