diff options
-rw-r--r-- | src/wm-client.cpp | 9 |
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())); |