+
+/**
+ * check if client subscribe event
+ *
+ * #### Parameters
+ * - event: homescreen event, tap_shortcut etc.
+ *
+ * #### Return
+ * true: found
+ * false: not found
+ *
+ */
+bool HS_Client::checkEvent(const char* event)
+{
+ auto ip = event_list.find(std::string(event));
+ if(ip == event_list.end())
+ return false;
+ else
+ return true;
+}
+
+/**
+ * check if event is supporting
+ *
+ * #### Parameters
+ * - event: homescreen event, tap_shortcut etc.
+ *
+ * #### Return
+ * true: support
+ * false: not fosupportund
+ *
+ */
+bool HS_Client::isSupportEvent(const char* event)
+{
+ auto ip = func_list.find(std::string(event));
+ if(ip == func_list.end())
+ return false;
+ else
+ return true;
+}
+
+/**
+ * handle homescreen event
+ *
+ * #### Parameters
+ * - request : the request
+ * - verb: request verb name
+ *
+ * #### Return
+ * 0: success
+ * others: fail
+ *
+ */
+int HS_Client::handleRequest(afb_req_t request, const char *verb)
+{
+ if((strcasecmp(verb, "subscribe") && strcasecmp(verb, "unsubscribe")) && !checkEvent(verb))
+ return 0;
+
+ int ret = AFB_EVENT_BAD_REQUEST;
+ auto ip = func_list.find(std::string(verb));
+ if(ip != func_list.end() && ip->second != nullptr) {
+ AFB_INFO("[%s]verb found", verb);
+ ret = (this->*(ip->second))(request);
+ }
+ return ret;
+}
+
+/**
+ * push event
+ *
+ * #### Parameters
+ * - event : the event want to push
+ * - param : the parameter contents of event
+ *
+ * #### Return
+ * 0 : success
+ * others : fail
+ *
+ */
+int HS_Client::pushEvent(const char *event, struct json_object *param)
+{
+ if(!checkEvent(event))
+ return 0;
+
+ AFB_INFO("called, event=%s.",event);
+ struct json_object* push_obj = json_object_new_object();
+ hs_add_object_to_json_object_str( push_obj, 4, _application_id, my_id.c_str(), _type, event);
+ if(param != nullptr)
+ json_object_object_add(push_obj, _parameter, param);
+ afb_event_push(my_event, push_obj);
+ return 0;
+}