X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=doc%2Fapi-ref%2Fhtml%2Fde%2Fdd0%2Fclass_lib_home_screen.html;fp=doc%2Fapi-ref%2Fhtml%2Fde%2Fdd0%2Fclass_lib_home_screen.html;h=2181e107c80e40c0decf37c491d23ab6f05cc809;hb=599de8d3f35cb0fe56c7e27591862d61944b456b;hp=42548a65015a94afd63d4501bee2c3f48c879e69;hpb=26ec25e2f9271396328c208ae1a256fdf1a92c91;p=apps%2Fagl-service-homescreen.git
diff --git a/doc/api-ref/html/de/dd0/class_lib_home_screen.html b/doc/api-ref/html/de/dd0/class_lib_home_screen.html
index 42548a6..2181e10 100644
--- a/doc/api-ref/html/de/dd0/class_lib_home_screen.html
+++ b/doc/api-ref/html/de/dd0/class_lib_home_screen.html
@@ -73,11 +73,12 @@ $(function() {
|
enum | EventType { Event_TapShortcut = 1,
-Event_OnScreenMessage
+Event_OnScreenMessage,
+Event_OnScreenReply
} |
|
-using | handler_func = std::function< void(const char *)> |
- |
+using | handler_func = std::function< void(json_object *)> |
+ |
|
@@ -91,13 +92,13 @@ Public Member Functions
|
int | init (const int port, const std::string &token) |
|
-int | runEventloop () |
- |
int | tapShortcut (const char *application_name) |
|
int | onScreenMessage (const char *display_message) |
|
-void | set_event_handler (enum EventType et, handler_func f) |
+int | onScreenReply (const char *reply_message) |
+ |
+void | set_event_handler (enum EventType et, handler_func f) |
|
void | registerCallback (void(*event_cb)(const std::string &event, struct json_object *event_contents), void(*reply_cb)(struct json_object *reply_contents), void(*hangup_cb)(void)=nullptr) |
|
@@ -129,19 +130,19 @@ Static Public Attributes
Definition at line 32 of file libhomescreen.hpp.
-
-◆ handler_func
+
+◆ handler_func
@@ -160,11 +161,13 @@ Static Public Attributes
Enumerator |
---|
Event_TapShortcut | |
Event_OnScreenMessage | |
+Event_OnScreenReply | |
-Definition at line 43 of file libhomescreen.hpp.
-
@@ -185,8 +188,8 @@ Static Public Attributes
@@ -205,8 +208,8 @@ Static Public Attributes
destructor
-
Definition at line 93 of file libhomescreen.cpp.
-
97 sd_event_unref(mploop);
99 if(sp_websock != NULL)
+
Definition at line 90 of file libhomescreen.cpp.
+
94 sd_event_unref(mploop);
96 if(sp_websock != NULL)
98 afb_wsj1_unref(sp_websock);
@@ -302,11 +305,11 @@ Static Public Attributes
Note
To call HomeScreen's APIs, the application should set its function name, arguments to JSON format.
-Definition at line 369 of file libhomescreen.cpp.
- 378 ELOG(
"verb doesn't exit");
383 ELOG(
"Failed to call verb:%s",verb);
-
-
static bool has_verb(const string &verb)
-
static void _on_reply_static(void *closure, struct afb_wsj1_msg *msg)
+
Definition at line 360 of file libhomescreen.cpp.
+
369 HMI_ERROR(
"libhomescreen",
"verb doesn't exit");
374 HMI_ERROR(
"libhomescreen",
"Failed to call verb:%s",verb);
#define HMI_ERROR(prefix, args,...)
+
+
static bool has_verb(const string &verb)
+
static void _on_reply_static(void *closure, struct afb_wsj1_msg *msg)
@@ -346,9 +349,9 @@ Static Public Attributes
Note
Use this constructor
-Definition at line 119 of file libhomescreen.cpp.
- 122 if(port > 0 && token.size() > 0)
129 ELOG(
"port and token should be > 0, Initial port and token uses.");
132 ret = initialize_websocket();
135 ELOG(
"Failed to initialize websocket");
-
+
Definition at line 116 of file libhomescreen.cpp.
+
119 if(port > 0 && token.size() > 0)
126 HMI_ERROR(
"libhomescreen",
"port and token should be > 0, Initial port and token uses.");
129 ret = initialize_websocket();
132 HMI_ERROR(
"libhomescreen",
"Failed to initialize websocket");
135 HMI_DEBUG(
"libhomescreen",
"Initialized");
#define HMI_ERROR(prefix, args,...)
+
#define HMI_DEBUG(prefix, args,...)
@@ -390,8 +393,8 @@ Static Public Attributes
@@ -426,12 +429,14 @@ Static Public Attributes
-
Definition at line 467 of file libhomescreen.cpp.
-
469 cout <<
"[libhomescreen on_event]: " <<
event <<
" (" << afb_wsj1_msg_object_s(msg) <<
")" << endl;
475 struct json_object* ev_contents = afb_wsj1_msg_object_j(msg);
476 struct json_object *json_data = json_object_object_get(ev_contents,
"data");
478 if(onEvent !=
nullptr)
480 const string ev(
event);
481 onEvent(ev, ev_contents);
484 const char* event_only = strchr(
event,
'/');
485 if (event_only !=
nullptr) {
486 event_only = event_only + 1;
492 struct json_object *json_application_name = json_object_object_get(json_data,
"application_name");
493 const char* application_name = json_object_get_string(json_application_name);
495 if ( i != this->handlers.end() ) {
496 i->second(application_name);
503 struct json_object *json_display_message = json_object_object_get(json_data,
"display_message");
504 const char* display_message = json_object_get_string(json_display_message);
506 if ( i != this->handlers.end() ) {
507 i->second(display_message);
512 json_object_put(ev_contents);
-
-
-
static const std::vector< std::string > event_list
-
+
Definition at line 458 of file libhomescreen.cpp.
+
460 HMI_DEBUG(
"libhomescreen",
"event: (%s) msg: (%s).",
event, afb_wsj1_msg_object_s(msg));
466 struct json_object* ev_contents = afb_wsj1_msg_object_j(msg);
467 struct json_object *json_data = json_object_object_get(ev_contents,
"data");
469 if(onEvent !=
nullptr)
471 const string ev(
event);
472 onEvent(ev, ev_contents);
475 const char* event_only = strchr(
event,
'/');
476 if (event_only !=
nullptr) {
477 event_only = event_only + 1;
482 if ( i != this->handlers.end() ) {
483 i->second(json_data);
488 if ( i != this->handlers.end() ) {
489 i->second(json_data);
494 if ( i != this->handlers.end() ) {
495 i->second(json_data);
499 json_object_put(ev_contents);
#define HMI_DEBUG(prefix, args,...)
+
+
+
+
+
static const std::vector< std::string > event_list
+
@@ -461,8 +466,8 @@ Static Public Attributes
-
Definition at line 448 of file libhomescreen.cpp.
-
450 DLOG(
"%s called", __FUNCTION__);
451 if(onHangup !=
nullptr)
+
Definition at line 439 of file libhomescreen.cpp.
+
441 HMI_DEBUG(
"libhomescreen",
"%s called", __FUNCTION__);
442 if(onHangup !=
nullptr)
#define HMI_DEBUG(prefix, args,...)
@@ -493,8 +498,9 @@ Static Public Attributes
msg is like ({"response":{"verb":"subscribe","error":0},"jtype":"afb-reply","request":{"status":"success","info":"homescreen binder subscribe event name [on_screen_message]"}}) msg is like ({"response":{"verb":"tap_shortcut","error":0},"jtype":"afb-reply","request":{"status":"success","info":"afb_event_push event [tap_shortcut]"}})
-
Definition at line 519 of file libhomescreen.cpp.
-
521 cout <<
"[libhomescreen on_reply]: " <<
" (" << afb_wsj1_msg_object_s(msg) <<
")" << endl;
522 if(onReply !=
nullptr)
524 struct json_object* reply = afb_wsj1_msg_object_j(msg);
527 json_object_put(reply);
+
Definition at line 506 of file libhomescreen.cpp.
+
508 HMI_DEBUG(
"libhomescreen",
"msg: (%s)", afb_wsj1_msg_object_s(msg));
509 if(onReply !=
nullptr)
511 struct json_object* reply = afb_wsj1_msg_object_j(msg);
514 json_object_put(reply);
#define HMI_DEBUG(prefix, args,...)
+
@@ -512,19 +518,50 @@ Static Public Attributes
-
HomeScreenã¢ããªã«è¡¨ç¤ºããã¡ãã»ã¼ã¸ã¤ãã³ãã®çºè¡
-
åã¢ããªããHomeScreenã¢ããªã±ã¼ã·ã§ã³ã®OnScreenã«è¡¨ç¤ºããã¤ãã³ããçºè¡ãã
+
Sending onScreen message event
+
Sending OnScreen message event to HomeScreen from applications
+
Parameters
+
+- display_message [in] : message for display
+
+
Return
+
+- Returns 0 on success or -1 in case of error.
+
+
+
Definition at line 244 of file libhomescreen.cpp.
+
251 struct json_object* j_obj = json_object_new_object();
252 struct json_object* val = json_object_new_string(display_message);
253 json_object_object_add(j_obj,
"display_message", val);
254 return this->
call(
"on_screen_message", j_obj);
int call(const std::string &verb, struct json_object *arg)
+
+
+
+
+◆ onScreenReply()
+
+
+
+
+
+ int LibHomeScreen::onScreenReply |
+ ( |
+ const char * |
+ reply_message | ) |
+ |
+
+
+
+
Sending onScreen reply event
+
Sending OnScreen reply event to applications from HomeScreen
Parameters
-- display_message [in] : 表示ããã¡ãã»ã¼ã¸
+- reply_message [in] : message for reply
Return
- Returns 0 on success or -1 in case of error.
-
Definition at line 280 of file libhomescreen.cpp.
-
287 struct json_object* j_obj = json_object_new_object();
288 struct json_object* val = json_object_new_string(display_message);
289 json_object_object_add(j_obj,
"display_message", val);
290 return this->
call(
"on_screen_message", j_obj);
int call(const std::string &verb, struct json_object *arg)
+
Definition at line 268 of file libhomescreen.cpp.
+
275 struct json_object* j_obj = json_object_new_object();
276 struct json_object* val = json_object_new_string(reply_message);
277 json_object_object_add(j_obj,
"reply_message", val);
278 return this->
call(
"on_screen_reply", j_obj);
int call(const std::string &verb, struct json_object *arg)
@@ -596,37 +633,8 @@ Static Public Attributes
Note
Event callback is invoked by home screen for event you subscribed. If you would like to get event, please call subscribe function before/after this function
-
Definition at line 158 of file libhomescreen.cpp.
-
165 onHangup = hangup_cb;
-
-
-
-◆ runEventloop()
-
-
-
-
-
- int LibHomeScreen::runEventloop |
- ( |
- | ) |
- |
-
-
-
-
This function start receiving the reply/event message from home screen
-
Parameters
-
Nothing
-
Return
-
-- Returns thread_id on success or -1 in case of error.
-
-
Note
-
-
Definition at line 224 of file libhomescreen.cpp.
-
226 if(mploop && sp_websock)
229 int ret = pthread_create(&thread_id, NULL,
event_loop_run, mploop);
232 ELOG(
"Cannot run eventloop due to error:%d", errno);
240 ELOG(
"Connecting is not established yet");
-
static void * event_loop_run(void *args)
-
+
Definition at line 155 of file libhomescreen.cpp.
+
162 onHangup = hangup_cb;
@@ -644,7 +652,7 @@ Static Public Attributes
|
|
- handler_func |
+ handler_func |
f |
@@ -654,21 +662,22 @@ Static Public Attributes
-
ã¤ãã³ããã³ãã©ã®ç»é²
-
åã¢ããªããHomeScreenã¢ããªã±ã¼ã·ã§ã³ã®OnScreenã«è¡¨ç¤ºããã¤ãã³ããçºè¡ãã
+
Setting Event Handler
+
Setting event handler for Homescreen
Parameters
-- et [in] : 対象ã®ã¤ãã³ã
-- f [in] : ã¤ãã³ããã³ãã©
+- et [in] : event name
+- f [in] : event handler
Return
Nothing
-
Definition at line 305 of file libhomescreen.cpp.
-
307 if (et >= 1 && et <= 2) {
317 this->handlers[et] = std::move(f);
-
int subscribe(const std::string &event_name)
-
static const std::vector< std::string > event_list
-
+
Definition at line 293 of file libhomescreen.cpp.
+
295 if (et >= 1 && et <= 3) {
308 this->handlers[et] = std::move(f);
+
+
int subscribe(const std::string &event_name)
+
static const std::vector< std::string > event_list
+
@@ -699,10 +708,10 @@ Static Public Attributes
Note
This function enables to get an event to your callback function.
-Definition at line 401 of file libhomescreen.cpp.
- 407 struct json_object* j_obj = json_object_new_object();
408 json_object_object_add(j_obj,
"event", json_object_new_string(event_name.c_str()));
412 ELOG(
"Failed to call verb:%s",__FUNCTION__);
-
-
static void _on_reply_static(void *closure, struct afb_wsj1_msg *msg)
+
Definition at line 392 of file libhomescreen.cpp.
+
398 struct json_object* j_obj = json_object_new_object();
399 json_object_object_add(j_obj,
"event", json_object_new_string(event_name.c_str()));
403 HMI_ERROR(
"libhomescreen",
"Failed to call verb:%s",__FUNCTION__);
#define HMI_ERROR(prefix, args,...)
+
+
static void _on_reply_static(void *closure, struct afb_wsj1_msg *msg)
@@ -721,19 +730,19 @@ Static Public Attributes
-
ã·ã§ã¼ãã«ããã¢ã¤ã³ã³ãã¿ãããããã¤ãã³ãã®çºè¡
-
HomeScreenã¢ããªã±ã¼ã·ã§ã³ã«ã¦åã¢ããªã¢ã¤ã³ã³ãã¿ãããããã¨ãã«ã¤ãã³ããçºè¡ãã
+
Sending ShortCut Icon tapped event
+
When HomeScreen shortcut area is tapped, sending a event
Parameters
-- application_name [in] : ã¿ãããããã¢ããªã±ã¼ã·ã§ã³ã®åå(label)
+- application_name [in] : Tapped application name (label)
Return
- Returns 0 on success or -1 in case of error.
-
Definition at line 256 of file libhomescreen.cpp.
-
263 struct json_object* j_obj = json_object_new_object();
264 struct json_object* val = json_object_new_string(application_name);
265 json_object_object_add(j_obj,
"application_name", val);
266 return this->
call(
"tap_shortcut", j_obj);
int call(const std::string &verb, struct json_object *arg)
+
Definition at line 220 of file libhomescreen.cpp.
+
227 struct json_object* j_obj = json_object_new_object();
228 struct json_object* val = json_object_new_string(application_name);
229 json_object_object_add(j_obj,
"application_name", val);
230 return this->
call(
"tap_shortcut", j_obj);
int call(const std::string &verb, struct json_object *arg)
@@ -764,10 +773,10 @@ Static Public Attributes
Note
This function disables to get an event to your callback function.
-Definition at line 430 of file libhomescreen.cpp.
- 436 struct json_object* j_obj = json_object_new_object();
437 json_object_object_add(j_obj,
"event", json_object_new_string(event_name.c_str()));
441 ELOG(
"Failed to call verb:%s",__FUNCTION__);
-
-
static void _on_reply_static(void *closure, struct afb_wsj1_msg *msg)
+
Definition at line 421 of file libhomescreen.cpp.
+
427 struct json_object* j_obj = json_object_new_object();
428 json_object_object_add(j_obj,
"event", json_object_new_string(event_name.c_str()));
432 HMI_ERROR(
"libhomescreen",
"Failed to call verb:%s",__FUNCTION__);
#define HMI_ERROR(prefix, args,...)
+
+
static void _on_reply_static(void *closure, struct afb_wsj1_msg *msg)
@@ -791,8 +800,8 @@ Static Public Attributes
-
Initial value:{
std::string("ping"),
std::string("tap_shortcut"),
std::string("on_screen_message"),
std::string("subscribe"),
std::string("unsubscribe")
}
-
Definition at line 48 of file libhomescreen.hpp.
+
Initial value:{
std::string("ping"),
std::string("tap_shortcut"),
std::string("on_screen_message"),
std::string("on_screen_reply"),
std::string("subscribe"),
std::string("unsubscribe")
}
+
Definition at line 50 of file libhomescreen.hpp.
@@ -815,13 +824,13 @@ Static Public Attributes
-
Initial value:{
std::string("tap_shortcut"),
std::string("on_screen_message"),
std::string("none")
}
-
Definition at line 49 of file libhomescreen.hpp.
+
Initial value:{
std::string("tap_shortcut"),
std::string("on_screen_message"),
std::string("on_screen_reply"),
std::string("none")
}
+
Definition at line 51 of file libhomescreen.hpp.
The documentation for this class was generated from the following files: