+
+/**
+ * showInformation event
+ *
+ * #### Parameters
+ * - request : the request
+ *
+ * #### Return
+ * 0 : success
+ * others : fail
+ *
+ */
+int HS_ClientManager::showInformation(afb_req_t request)
+{
+ int ret = 0;
+ std::lock_guard<std::mutex> lock(this->mtx);
+ auto ip = client_list.find(_homescreen);
+ if(ip != client_list.end()) {
+ ret = ip->second->showInformation(request);
+ }
+ else {
+ HMI_NOTICE("homescreen-service","not exist sessiion with homescreen");
+ ret = AFB_REQ_SHOWINFORMATION_ERROR;
+ }
+
+ return ret;
+}
+
+/**
+ * push event
+ *
+ * #### Parameters
+ * - event : the event want to push
+ * - param : the parameter contents of event
+ * - appid : the destination application's id
+ *
+ * #### Return
+ * 0 : success
+ * others : fail
+ *
+ */
+int HS_ClientManager::pushEvent(const char *event, struct json_object *param, std::string appid)
+{
+ if(event == nullptr) {
+ HMI_ERROR("homescreen-service","event name is null.");
+ return -1;
+ }
+
+ if(appid.empty()) { // broadcast event to clients who subscribed this event
+ std::lock_guard<std::mutex> lock(this->mtx);
+ for(auto m : client_list) {
+ m.second->pushEvent(event, param);
+ }
+ }
+ else { // push event to specific client
+ std::lock_guard<std::mutex> lock(this->mtx);
+ auto ip = client_list.find(appid);
+ if(ip != client_list.end()) {
+ ip->second->pushEvent(event, param);
+ }
+ }
+
+ return 0;
+}
+
+int HS_ClientManager::handleRequest(const char *verb, afb_req_t request)
+{
+ HMI_NOTICE("homescreen-service","verb = %s", verb);
+ int ret = AFB_EVENT_BAD_REQUEST;
+ auto ip = func_list.find(std::string(verb));
+ if(ip != func_list.end()) {
+ HMI_NOTICE("homescreen-service","verb found");
+ ret = (this->*(ip->second))(request);
+ }
+ return ret;
+}
\ No newline at end of file