From 31ff5ce755d00cf12ea2ffc96c33ed9acd36358f Mon Sep 17 00:00:00 2001 From: wang_zhiqiang Date: Wed, 21 Nov 2018 16:32:29 +0800 Subject: update doc add new sequence and update doxygen files. Change-Id: I6737939eb2628577d58b2d1d65086e46e7cb14a4 Signed-off-by: wang_zhiqiang --- doc/api-ref/html/d2/d66/include_2hmi-debug_8h.html | 490 +++++++++++++++ .../html/d2/d66/include_2hmi-debug_8h_source.html | 109 ++++ .../html/d2/d8e/class_h_s___client_manager.html | 670 +++++++++++++++++++++ 3 files changed, 1269 insertions(+) create mode 100644 doc/api-ref/html/d2/d66/include_2hmi-debug_8h.html create mode 100644 doc/api-ref/html/d2/d66/include_2hmi-debug_8h_source.html create mode 100644 doc/api-ref/html/d2/d8e/class_h_s___client_manager.html (limited to 'doc/api-ref/html/d2') diff --git a/doc/api-ref/html/d2/d66/include_2hmi-debug_8h.html b/doc/api-ref/html/d2/d66/include_2hmi-debug_8h.html new file mode 100644 index 0000000..10e01be --- /dev/null +++ b/doc/api-ref/html/d2/d66/include_2hmi-debug_8h.html @@ -0,0 +1,490 @@ + + + + + + +HomeScreenBinding: include/hmi-debug.h File Reference + + + + + + + + + + +
+
+ + + + + + +
+
HomeScreenBinding +
+
+
+ + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+
hmi-debug.h File Reference
+
+
+
#include <time.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+#include <stdlib.h>
+
+

Go to the source code of this file.

+ + + + + + + + + + + + + + +

+Macros

#define __FILENAME__   (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
 
#define HMI_ERROR(prefix, args, ...)   _HMI_LOG(LOG_LEVEL_ERROR, __FILENAME__, __FUNCTION__, __LINE__, prefix, args, ##__VA_ARGS__)
 
#define HMI_WARNING(prefix, args, ...)   _HMI_LOG(LOG_LEVEL_WARNING, __FILENAME__, __FUNCTION__,__LINE__, prefix, args,##__VA_ARGS__)
 
#define HMI_NOTICE(prefix, args, ...)   _HMI_LOG(LOG_LEVEL_NOTICE, __FILENAME__, __FUNCTION__,__LINE__, prefix, args,##__VA_ARGS__)
 
#define HMI_INFO(prefix, args, ...)   _HMI_LOG(LOG_LEVEL_INFO, __FILENAME__, __FUNCTION__,__LINE__, prefix, args,##__VA_ARGS__)
 
#define HMI_DEBUG(prefix, args, ...)   _HMI_LOG(LOG_LEVEL_DEBUG, __FILENAME__, __FUNCTION__,__LINE__, prefix, args,##__VA_ARGS__)
 
+ + + +

+Enumerations

enum  LOG_LEVEL {
+  LOG_LEVEL_NONE = 0, +LOG_LEVEL_ERROR, +LOG_LEVEL_WARNING, +LOG_LEVEL_NOTICE, +
+  LOG_LEVEL_INFO, +LOG_LEVEL_DEBUG, +LOG_LEVEL_MAX = LOG_LEVEL_DEBUG, +LOG_LEVEL_NONE = 0, +
+  LOG_LEVEL_ERROR, +LOG_LEVEL_WARNING, +LOG_LEVEL_NOTICE, +LOG_LEVEL_INFO, +
+  LOG_LEVEL_DEBUG, +LOG_LEVEL_MAX = LOG_LEVEL_DEBUG +
+ }
 
+ + + +

+Functions

static void _HMI_LOG (enum LOG_LEVEL level, const char *file, const char *func, const int line, const char *prefix, const char *log,...)
 
+ + + +

+Variables

static char ERROR_FLAG [6][20] = {"NONE", "ERROR", "WARNING", "NOTICE", "INFO", "DEBUG"}
 
+

Macro Definition Documentation

+ +
+
+ + + + +
#define __FILENAME__   (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
+
+ +

Definition at line 36 of file hmi-debug.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define HMI_DEBUG( prefix,
 args,
 ... 
)   _HMI_LOG(LOG_LEVEL_DEBUG, __FILENAME__, __FUNCTION__,__LINE__, prefix, args,##__VA_ARGS__)
+
+ +

Definition at line 42 of file hmi-debug.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define HMI_ERROR( prefix,
 args,
 ... 
)   _HMI_LOG(LOG_LEVEL_ERROR, __FILENAME__, __FUNCTION__, __LINE__, prefix, args, ##__VA_ARGS__)
+
+ +

Definition at line 38 of file hmi-debug.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define HMI_INFO( prefix,
 args,
 ... 
)   _HMI_LOG(LOG_LEVEL_INFO, __FILENAME__, __FUNCTION__,__LINE__, prefix, args,##__VA_ARGS__)
+
+ +

Definition at line 41 of file hmi-debug.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define HMI_NOTICE( prefix,
 args,
 ... 
)   _HMI_LOG(LOG_LEVEL_NOTICE, __FILENAME__, __FUNCTION__,__LINE__, prefix, args,##__VA_ARGS__)
+
+ +

Definition at line 40 of file hmi-debug.h.

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
#define HMI_WARNING( prefix,
 args,
 ... 
)   _HMI_LOG(LOG_LEVEL_WARNING, __FILENAME__, __FUNCTION__,__LINE__, prefix, args,##__VA_ARGS__)
+
+ +

Definition at line 39 of file hmi-debug.h.

+ +
+
+

Enumeration Type Documentation

+ +
+
+ + + + +
enum LOG_LEVEL
+
+ + + + + + + + + + + + + + + +
Enumerator
LOG_LEVEL_NONE  +
LOG_LEVEL_ERROR  +
LOG_LEVEL_WARNING  +
LOG_LEVEL_NOTICE  +
LOG_LEVEL_INFO  +
LOG_LEVEL_DEBUG  +
LOG_LEVEL_MAX  +
LOG_LEVEL_NONE  +
LOG_LEVEL_ERROR  +
LOG_LEVEL_WARNING  +
LOG_LEVEL_NOTICE  +
LOG_LEVEL_INFO  +
LOG_LEVEL_DEBUG  +
LOG_LEVEL_MAX  +
+ +

Definition at line 26 of file hmi-debug.h.

+ +
+
+

Function Documentation

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
static void _HMI_LOG (enum LOG_LEVEL level,
const char * file,
const char * func,
const int line,
const char * prefix,
const char * log,
 ... 
)
+
+static
+
+ +

Definition at line 46 of file hmi-debug.h.

+
47 {
48  const int log_level = (getenv("USE_HMI_DEBUG") == NULL)?LOG_LEVEL_ERROR:atoi(getenv("USE_HMI_DEBUG"));
49  if(log_level < level)
50  {
51  return;
52  }
53 
54  char *message;
55  struct timespec tp;
56  unsigned int time;
57 
58  clock_gettime(CLOCK_REALTIME, &tp);
59  time = (tp.tv_sec * 1000000L) + (tp.tv_nsec / 1000);
60 
61  va_list args;
62  va_start(args, log);
63  if (log == NULL || vasprintf(&message, log, args) < 0)
64  message = NULL;
65  fprintf(stderr, "[%10.3f] [%s %s] [%s, %s(), Line:%d] >>> %s \n", time / 1000.0, prefix, ERROR_FLAG[level], file, func, line, message);
66  va_end(args);
67  free(message);
68 }
+
static char ERROR_FLAG[6][20]
Definition: hmi-debug.h:44
+
+
+
+

Variable Documentation

+ +
+
+ + + + + +
+ + + + +
char ERROR_FLAG[6][20] = {"NONE", "ERROR", "WARNING", "NOTICE", "INFO", "DEBUG"}
+
+static
+
+ +

Definition at line 44 of file hmi-debug.h.

+ +
+
+
+ + + + diff --git a/doc/api-ref/html/d2/d66/include_2hmi-debug_8h_source.html b/doc/api-ref/html/d2/d66/include_2hmi-debug_8h_source.html new file mode 100644 index 0000000..54a369f --- /dev/null +++ b/doc/api-ref/html/d2/d66/include_2hmi-debug_8h_source.html @@ -0,0 +1,109 @@ + + + + + + +HomeScreenBinding: include/hmi-debug.h Source File + + + + + + + + + + +
+
+ + + + + + +
+
HomeScreenBinding +
+
+
+ + + + + + +
+
+ + +
+ +
+ + +
+
+
+
hmi-debug.h
+
+
+Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 TOYOTA MOTOR CORPORATION
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef __HMI_DEBUG_H__
18 #define __HMI_DEBUG_H__
19 
20 #include <time.h>
21 #include <stdio.h>
22 #include <stdarg.h>
23 #include <string.h>
24 #include <stdlib.h>
25 
26 enum LOG_LEVEL{
34 };
35 
36 #define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
37 
38 #define HMI_ERROR(prefix, args,...) _HMI_LOG(LOG_LEVEL_ERROR, __FILENAME__, __FUNCTION__, __LINE__, prefix, args, ##__VA_ARGS__)
39 #define HMI_WARNING(prefix, args,...) _HMI_LOG(LOG_LEVEL_WARNING, __FILENAME__, __FUNCTION__,__LINE__, prefix, args,##__VA_ARGS__)
40 #define HMI_NOTICE(prefix, args,...) _HMI_LOG(LOG_LEVEL_NOTICE, __FILENAME__, __FUNCTION__,__LINE__, prefix, args,##__VA_ARGS__)
41 #define HMI_INFO(prefix, args,...) _HMI_LOG(LOG_LEVEL_INFO, __FILENAME__, __FUNCTION__,__LINE__, prefix, args,##__VA_ARGS__)
42 #define HMI_DEBUG(prefix, args,...) _HMI_LOG(LOG_LEVEL_DEBUG, __FILENAME__, __FUNCTION__,__LINE__, prefix, args,##__VA_ARGS__)
43 
44 static char ERROR_FLAG[6][20] = {"NONE", "ERROR", "WARNING", "NOTICE", "INFO", "DEBUG"};
45 
46 static void _HMI_LOG(enum LOG_LEVEL level, const char* file, const char* func, const int line, const char* prefix, const char* log, ...)
47 {
48  const int log_level = (getenv("USE_HMI_DEBUG") == NULL)?LOG_LEVEL_ERROR:atoi(getenv("USE_HMI_DEBUG"));
49  if(log_level < level)
50  {
51  return;
52  }
53 
54  char *message;
55  struct timespec tp;
56  unsigned int time;
57 
58  clock_gettime(CLOCK_REALTIME, &tp);
59  time = (tp.tv_sec * 1000000L) + (tp.tv_nsec / 1000);
60 
61  va_list args;
62  va_start(args, log);
63  if (log == NULL || vasprintf(&message, log, args) < 0)
64  message = NULL;
65  fprintf(stderr, "[%10.3f] [%s %s] [%s, %s(), Line:%d] >>> %s \n", time / 1000.0, prefix, ERROR_FLAG[level], file, func, line, message);
66  va_end(args);
67  free(message);
68 }
69 
70 #endif //__HMI_DEBUG_H__
+
LOG_LEVEL
Definition: hmi-debug.h:26
+
static void _HMI_LOG(enum LOG_LEVEL level, const char *file, const char *func, const int line, const char *prefix, const char *log,...)
Definition: hmi-debug.h:46
+ + + + + +
static char ERROR_FLAG[6][20]
Definition: hmi-debug.h:44
+ +
+ + + + diff --git a/doc/api-ref/html/d2/d8e/class_h_s___client_manager.html b/doc/api-ref/html/d2/d8e/class_h_s___client_manager.html new file mode 100644 index 0000000..da86b35 --- /dev/null +++ b/doc/api-ref/html/d2/d8e/class_h_s___client_manager.html @@ -0,0 +1,670 @@ + + + + + + +HomeScreenBinding: HS_ClientManager Class Reference + + + + + + + + + + +
+
+ + + + + + +
+
HomeScreenBinding +
+
+
+ + + + + + +
+
+ + +
+ +
+ +
+
+ +
+
HS_ClientManager Class Reference
+
+
+ +

#include <hs-clientmanager.h>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 HS_ClientManager ()
 
 ~HS_ClientManager ()=default
 
 HS_ClientManager (HS_ClientManager const &)=delete
 
HS_ClientManageroperator= (HS_ClientManager const &)=delete
 
 HS_ClientManager (HS_ClientManager &&)=delete
 
HS_ClientManageroperator= (HS_ClientManager &&)=delete
 
int init (void)
 
void removeClientCtxt (void *data)
 
int tap_shortcut (afb_req_t request)
 
int showWindow (afb_req_t request)
 
int hideWindow (afb_req_t request)
 
int replyShowWindow (afb_req_t request)
 
int on_screen_message (afb_req_t request)
 
int on_screen_reply (afb_req_t request)
 
int subscribe (afb_req_t request)
 
int unsubscribe (afb_req_t request)
 
int showNotification (afb_req_t request)
 
int showInformation (afb_req_t request)
 
+ + + +

+Static Public Member Functions

static HS_ClientManagerinstance (void)
 
+

Detailed Description

+
+

Definition at line 37 of file hs-clientmanager.h.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + +
HS_ClientManager::HS_ClientManager ()
+
+

HS_ClientManager construction function

+

Parameters

+
    +
  • Nothing
  • +
+

Return

+

None

+ +

Definition at line 39 of file hs-clientmanager.cpp.

+
40 {
41 }
+
+
+ +
+
+ + + + + +
+ + + + + + + +
HS_ClientManager::~HS_ClientManager ()
+
+default
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
HS_ClientManager::HS_ClientManager (HS_ClientManager const & )
+
+delete
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
HS_ClientManager::HS_ClientManager (HS_ClientManager && )
+
+delete
+
+ +
+
+

Member Function Documentation

+ +
+
+ + + + + + + + +
int HS_ClientManager::hideWindow (afb_req_t request)
+
+

hideWindow event

+

Parameters

+
    +
  • request : the request
  • +
+

Return

+

0 : success others : fail

+ +

Definition at line 356 of file hs-clientmanager.cpp.

+
357 {
358  int ret = 0;
359  const char* value = afb_req_value(request, _application_id);
360  if (value) {
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);
366  }
367  }
368  else {
369  HMI_NOTICE("homescreen-service","Please input application_id");
370  ret = AFB_EVENT_BAD_REQUEST;
371  }
372  return ret;
373 }
#define HMI_NOTICE(prefix, args,...)
Definition: hmi-debug.h:40
+
const char _application_id[]
Definition: homescreen.cpp:28
+
#define AFB_EVENT_BAD_REQUEST
Definition: hs-helper.h:23
+
+
+
+ +
+
+ + + + + + + + +
int HS_ClientManager::init (void )
+
+

HS_ClientManager init function

+

Parameters

+
    +
  • Nothing
  • +
+

Return

+

init result

+ +

Definition at line 71 of file hs-clientmanager.cpp.

+
72 {
73  HMI_NOTICE("homescreen-service","called.");
74 }
#define HMI_NOTICE(prefix, args,...)
Definition: hmi-debug.h:40
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
HS_ClientManager * HS_ClientManager::instance (void )
+
+static
+
+

get instance

+

Parameters

+
    +
  • Nothing
  • +
+

Return

+

HS_ClientManager instance pointer

+ +

Definition at line 53 of file hs-clientmanager.cpp.

+
54 {
55  if(me == nullptr)
56  me = new HS_ClientManager();
57 
58  return me;
59 }
+
+
+
+ +
+
+ + + + + + + + +
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.

+
196 {
197  int ret = 0;
198  const char* value = afb_req_value(request, _display_message);
199  if (value) {
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);
204  }
205  }
206  else {
207  HMI_NOTICE("homescreen-service","Please input display_message");
208  ret = AFB_EVENT_BAD_REQUEST;
209  }
210  return ret;
211 }
#define HMI_NOTICE(prefix, args,...)
Definition: hmi-debug.h:40
+
const char _display_message[]
Definition: homescreen.cpp:29
+
#define AFB_EVENT_BAD_REQUEST
Definition: hs-helper.h:23
+
+
+
+ +
+
+ + + + + + + + +
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.

+
224 {
225  int ret = 0;
226  const char* value = afb_req_value(request, _reply_message);
227  if (value) {
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);
232  }
233  }
234  else {
235  HMI_NOTICE("homescreen-service","Please input reply_message");
236  ret = AFB_EVENT_BAD_REQUEST;
237  }
238  return ret;
239 }
const char _reply_message[]
Definition: homescreen.cpp:30
+
#define HMI_NOTICE(prefix, args,...)
Definition: hmi-debug.h:40
+
#define AFB_EVENT_BAD_REQUEST
Definition: hs-helper.h:23
+
+
+
+ +
+
+ + + + + +
+ + + + + + + + +
HS_ClientManager& HS_ClientManager::operator= (HS_ClientManager const & )
+
+delete
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + +
HS_ClientManager& HS_ClientManager::operator= (HS_ClientManager && )
+
+delete
+
+ +
+
+ +
+
+ + + + + + + + +
void HS_ClientManager::removeClientCtxt (void * data)
+
+

remove Client from list

+

Parameters

+ +

Return

+

None

+ +

Definition at line 140 of file hs-clientmanager.cpp.

+
141 {
142  HS_ClientCtxt *ctxt = (HS_ClientCtxt *)data;
143  if(ctxt == nullptr)
144  {
145  HMI_ERROR("homescreen-service", "data is nullptr");
146  return;
147  }
148 
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);
154 }
+
#define HMI_NOTICE(prefix, args,...)
Definition: hmi-debug.h:40
+
std::string id
+
#define HMI_ERROR(prefix, args,...)
Definition: hmi-debug.h:38
+
+
+
+ +
+
+ + + + + + + + +
int HS_ClientManager::replyShowWindow (afb_req_t request)
+
+

replyShowWindow event

+

Parameters

+
    +
  • request : the request
  • +
+

Return

+

0 : success others : fail

+ +

Definition at line 386 of file hs-clientmanager.cpp.

+
387 {
388  int ret = 0;
389  const char* value = afb_req_value(request, _application_id);
390  if (value) {
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);
396  }
397  }
398  else {
399  HMI_NOTICE("homescreen-service","Please input application_id");
400  ret = AFB_EVENT_BAD_REQUEST;
401  }
402  return ret;
403 }
#define HMI_NOTICE(prefix, args,...)
Definition: hmi-debug.h:40
+
const char _application_id[]
Definition: homescreen.cpp:28
+
#define AFB_EVENT_BAD_REQUEST
Definition: hs-helper.h:23
+
+
+
+ +
+
+ + + + + + + + +
int HS_ClientManager::showInformation (afb_req_t request)
+
+

showInformation event

+

Parameters

+
    +
  • request : the request
  • +
+

Return

+

0 : success others : fail

+ +

Definition at line 443 of file hs-clientmanager.cpp.

+
444 {
445  int ret = 0;
446  std::lock_guard<std::mutex> lock(this->mtx);
447  auto ip = client_list.find(_homescreen);
448  if(ip != client_list.end()) {
449  ret = ip->second->showInformation(request);
450  }
451  else {
452  HMI_NOTICE("homescreen-service","not exist sessiion with homescreen");
454  }
455 
456  return ret;
457 }
#define HMI_NOTICE(prefix, args,...)
Definition: hmi-debug.h:40
+
static const char _homescreen[]
+
#define AFB_REQ_SHOWINFORMATION_ERROR
Definition: hs-helper.h:27
+
+
+
+ +
+
+ + + + + + + + +
int HS_ClientManager::showNotification (afb_req_t request)
+
+

showNotification event

+

Parameters

+
    +
  • request : the request
  • +
+

Return

+

0 : success others : fail

+ +

Definition at line 416 of file hs-clientmanager.cpp.

+
417 {
418  int ret = 0;
419  std::lock_guard<std::mutex> lock(this->mtx);
420  auto ip = client_list.find(_homescreen);
421  if(ip != client_list.end()) {
422  ret = ip->second->showNotification(request);
423  }
424  else {
425  HMI_NOTICE("homescreen-service","not exist sessiion with homescreen");
427  }
428 
429  return ret;
430 }
#define AFB_REQ_SHOWNOTIFICATION_ERROR
Definition: hs-helper.h:26
+
#define HMI_NOTICE(prefix, args,...)
Definition: hmi-debug.h:40
+
static const char _homescreen[]
+
+
+
+ +
+
+ + + + + + + + +
int HS_ClientManager::showWindow (afb_req_t request)
+
+

showWindow event

+

Parameters

+
    +
  • request : the request
  • +
+

Return

+

0 : success others : fail

+ +

Definition at line 326 of file hs-clientmanager.cpp.

+
327 {
328  int ret = 0;
329  const char* value = afb_req_value(request, _application_id);
330  if (value) {
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);
336  }
337  }
338  else {
339  HMI_NOTICE("homescreen-service","Please input application_id");
340  ret = AFB_EVENT_BAD_REQUEST;
341  }
342  return ret;
343 }
#define HMI_NOTICE(prefix, args,...)
Definition: hmi-debug.h:40
+
const char _application_id[]
Definition: homescreen.cpp:28
+
#define AFB_EVENT_BAD_REQUEST
Definition: hs-helper.h:23
+
+
+
+ +
+
+ + + + + + + + +
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.

+
252 {
253  int ret = 0;
254  const char *value = afb_req_value(request, "event");
255  HMI_NOTICE("homescreen-service","value is %s", value);
256  if(value) {
257  std::string appid(afb_req_get_application_id(request));
258  std::lock_guard<std::mutex> lock(this->mtx);
259 
260  HS_Client* client = nullptr;
261  auto ip = client_list.find(appid);
262  if(ip != client_list.end()) {
263  client = client_list[appid];
264  }
265  else {
266  appid2ctxt[appid] = createClientCtxt(request, appid);
267  client = addClient(request, appid);
268  }
269 
270  if(client->subscribe(request, value) != 0) {
271  HMI_NOTICE("homescreen-service","subscribe failed");
273  }
274  }
275  else {
276  HMI_NOTICE("homescreen-service","Please input event name");
277  ret = AFB_EVENT_BAD_REQUEST;
278  }
279  return ret;
280 }
int subscribe(afb_req_t request, const char *event)
Definition: hs-client.cpp:139
+ +
#define HMI_NOTICE(prefix, args,...)
Definition: hmi-debug.h:40
+
#define AFB_EVENT_BAD_REQUEST
Definition: hs-helper.h:23
+
#define AFB_REQ_SUBSCRIBE_ERROR
Definition: hs-helper.h:24
+
+
+
+ +
+
+ + + + + + + + +
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.

+
167 {
168  int ret = 0;
169  const char* value = afb_req_value(request, _application_id);
170  if (value) {
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);
176  }
177  }
178  else {
179  HMI_NOTICE("homescreen-service","Please input application_id");
180  ret = AFB_EVENT_BAD_REQUEST;
181  }
182  return ret;
183 }
#define HMI_NOTICE(prefix, args,...)
Definition: hmi-debug.h:40
+
const char _application_id[]
Definition: homescreen.cpp:28
+
#define AFB_EVENT_BAD_REQUEST
Definition: hs-helper.h:23
+
+
+
+ +
+
+ + + + + + + + +
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.

+
293 {
294  const char *value = afb_req_value(request, "event");
295  HMI_NOTICE("homescreen-service","value is %s", value);
296  int ret = 0;
297  if(value) {
298  std::string appid(afb_req_get_application_id(request));
299  std::lock_guard<std::mutex> lock(this->mtx);
300 
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");
306  }
307  }
308  else {
309  HMI_NOTICE("homescreen-service","Please input event name");
310  ret = AFB_EVENT_BAD_REQUEST;
311  }
312  return ret;
313 }
#define HMI_NOTICE(prefix, args,...)
Definition: hmi-debug.h:40
+
#define AFB_REQ_UNSUBSCRIBE_ERROR
Definition: hs-helper.h:25
+
#define AFB_EVENT_BAD_REQUEST
Definition: hs-helper.h:23
+
+
+
+
The documentation for this class was generated from the following files: +
+ + + + -- cgit 1.2.3-korg