#include <hs-clientmanager.h>
Definition at line 37 of file hs-clientmanager.h.
HS_ClientManager::HS_ClientManager |
( |
| ) |
|
HS_ClientManager::~HS_ClientManager |
( |
| ) |
|
|
default |
int HS_ClientManager::hideWindow |
( |
afb_req_t |
request | ) |
|
hideWindow event
Parameters
Return
0 : success others : fail
Definition at line 356 of file hs-clientmanager.cpp.
361 HMI_NOTICE(
"homescreen-service",
"request params = %s.", value);
362 std::lock_guard<std::mutex> lock(this->mtx);
363 auto ip = client_list.find(std::string(value));
364 if(ip != client_list.end()) {
365 ret = ip->second->hideWindow(request);
369 HMI_NOTICE(
"homescreen-service",
"Please input application_id");
#define HMI_NOTICE(prefix, args,...)
const char _application_id[]
#define AFB_EVENT_BAD_REQUEST
int HS_ClientManager::init |
( |
void |
| ) |
|
int HS_ClientManager::on_screen_message |
( |
afb_req_t |
request | ) |
|
on_screen_message
Parameters
- request: the request to bindings
Return
result
Definition at line 195 of file hs-clientmanager.cpp.
200 HMI_NOTICE(
"homescreen-service",
"request params = %s.", value);
201 std::lock_guard<std::mutex> lock(this->mtx);
202 for(
auto m : client_list) {
203 m.second->on_screen_message(request, value);
207 HMI_NOTICE(
"homescreen-service",
"Please input display_message");
#define HMI_NOTICE(prefix, args,...)
const char _display_message[]
#define AFB_EVENT_BAD_REQUEST
int HS_ClientManager::on_screen_reply |
( |
afb_req_t |
request | ) |
|
on_screen_reply
Parameters
- request: the request to bindings
Return
result
Definition at line 223 of file hs-clientmanager.cpp.
228 HMI_NOTICE(
"homescreen-service",
"request params = %s.", value);
229 std::lock_guard<std::mutex> lock(this->mtx);
230 for(
auto m : client_list) {
231 m.second->on_screen_reply(request, value);
235 HMI_NOTICE(
"homescreen-service",
"Please input reply_message");
const char _reply_message[]
#define HMI_NOTICE(prefix, args,...)
#define AFB_EVENT_BAD_REQUEST
void HS_ClientManager::removeClientCtxt |
( |
void * |
data | ) |
|
remove Client from list
Parameters
Return
None
Definition at line 140 of file hs-clientmanager.cpp.
145 HMI_ERROR(
"homescreen-service",
"data is nullptr");
149 HMI_NOTICE(
"homescreen-service",
"remove app %s", ctxt->
id.c_str());
150 std::lock_guard<std::mutex> lock(this->mtx);
151 removeClient(ctxt->
id);
152 delete appid2ctxt[ctxt->
id];
153 appid2ctxt.erase(ctxt->
id);
#define HMI_NOTICE(prefix, args,...)
#define HMI_ERROR(prefix, args,...)
int HS_ClientManager::replyShowWindow |
( |
afb_req_t |
request | ) |
|
replyShowWindow event
Parameters
Return
0 : success others : fail
Definition at line 386 of file hs-clientmanager.cpp.
391 HMI_NOTICE(
"homescreen-service",
"request params = %s.", value);
392 std::lock_guard<std::mutex> lock(this->mtx);
393 auto ip = client_list.find(std::string(value));
394 if(ip != client_list.end()) {
395 ret = ip->second->replyShowWindow(request, value);
399 HMI_NOTICE(
"homescreen-service",
"Please input application_id");
#define HMI_NOTICE(prefix, args,...)
const char _application_id[]
#define AFB_EVENT_BAD_REQUEST
int HS_ClientManager::showInformation |
( |
afb_req_t |
request | ) |
|
showInformation event
Parameters
Return
0 : success others : fail
Definition at line 443 of file hs-clientmanager.cpp.
446 std::lock_guard<std::mutex> lock(this->mtx);
448 if(ip != client_list.end()) {
449 ret = ip->second->showInformation(request);
452 HMI_NOTICE(
"homescreen-service",
"not exist sessiion with homescreen");
#define HMI_NOTICE(prefix, args,...)
static const char _homescreen[]
#define AFB_REQ_SHOWINFORMATION_ERROR
int HS_ClientManager::showNotification |
( |
afb_req_t |
request | ) |
|
showNotification event
Parameters
Return
0 : success others : fail
Definition at line 416 of file hs-clientmanager.cpp.
419 std::lock_guard<std::mutex> lock(this->mtx);
421 if(ip != client_list.end()) {
422 ret = ip->second->showNotification(request);
425 HMI_NOTICE(
"homescreen-service",
"not exist sessiion with homescreen");
#define AFB_REQ_SHOWNOTIFICATION_ERROR
#define HMI_NOTICE(prefix, args,...)
static const char _homescreen[]
int HS_ClientManager::showWindow |
( |
afb_req_t |
request | ) |
|
showWindow event
Parameters
Return
0 : success others : fail
Definition at line 326 of file hs-clientmanager.cpp.
331 HMI_NOTICE(
"homescreen-service",
"request params = %s.", value);
332 std::lock_guard<std::mutex> lock(this->mtx);
333 auto ip = client_list.find(std::string(value));
334 if(ip != client_list.end()) {
335 ret = ip->second->showWindow(request, value);
339 HMI_NOTICE(
"homescreen-service",
"Please input application_id");
#define HMI_NOTICE(prefix, args,...)
const char _application_id[]
#define AFB_EVENT_BAD_REQUEST
int HS_ClientManager::subscribe |
( |
afb_req_t |
request | ) |
|
subscribe
Parameters
- request: the request to bindings
Return
result
Definition at line 251 of file hs-clientmanager.cpp.
254 const char *value = afb_req_value(request,
"event");
255 HMI_NOTICE(
"homescreen-service",
"value is %s", value);
257 std::string appid(afb_req_get_application_id(request));
258 std::lock_guard<std::mutex> lock(this->mtx);
261 auto ip = client_list.find(appid);
262 if(ip != client_list.end()) {
263 client = client_list[appid];
266 appid2ctxt[appid] = createClientCtxt(request, appid);
267 client = addClient(request, appid);
270 if(client->
subscribe(request, value) != 0) {
271 HMI_NOTICE(
"homescreen-service",
"subscribe failed");
276 HMI_NOTICE(
"homescreen-service",
"Please input event name");
int subscribe(afb_req_t request, const char *event)
#define HMI_NOTICE(prefix, args,...)
#define AFB_EVENT_BAD_REQUEST
#define AFB_REQ_SUBSCRIBE_ERROR
int HS_ClientManager::tap_shortcut |
( |
afb_req_t |
request | ) |
|
tap_shortcut
Parameters
- request: the request to bindings
Return
result
Definition at line 166 of file hs-clientmanager.cpp.
171 HMI_NOTICE(
"homescreen-service",
"request params = %s.", value);
172 std::lock_guard<std::mutex> lock(this->mtx);
173 auto ip = client_list.find(std::string(value));
174 if(ip != client_list.end()) {
175 ip->second->tap_shortcut(value);
179 HMI_NOTICE(
"homescreen-service",
"Please input application_id");
#define HMI_NOTICE(prefix, args,...)
const char _application_id[]
#define AFB_EVENT_BAD_REQUEST
int HS_ClientManager::unsubscribe |
( |
afb_req_t |
request | ) |
|
unsubscribe
Parameters
- request: the request to bindings
Return
result
Definition at line 292 of file hs-clientmanager.cpp.
294 const char *value = afb_req_value(request,
"event");
295 HMI_NOTICE(
"homescreen-service",
"value is %s", value);
298 std::string appid(afb_req_get_application_id(request));
299 std::lock_guard<std::mutex> lock(this->mtx);
301 auto ip = client_list.find(appid);
302 if(ip != client_list.end()
303 && ip->second->unsubscribe(request, value) != 0) {
304 HMI_NOTICE(
"homescreen-service",
"unsubscribe failed");
309 HMI_NOTICE(
"homescreen-service",
"Please input event name");
#define HMI_NOTICE(prefix, args,...)
#define AFB_REQ_UNSUBSCRIBE_ERROR
#define AFB_EVENT_BAD_REQUEST
The documentation for this class was generated from the following files: