From 599de8d3f35cb0fe56c7e27591862d61944b456b Mon Sep 17 00:00:00 2001 From: zheng_wenlong Date: Mon, 23 Oct 2017 14:06:12 +0900 Subject: Add a new OnScreenReply api to agl-service-homescreen Add a new event named OnScreenReply. Applications can use this event to reply to the homescreen. Also update the documentation for this event. [Patch Sets 8,9] Update ApplicationGuide.md. For details: Use master source build agl-service-homescreen-2017. Change agl version to EE. Add libhomescreen sample code path. [Patch Sets 10] Delete tailing space. BUG-AGL: SPEC-985 Change-Id: Iea0c321731fa62cd94fc08fc5e303c20847fd525 Signed-off-by: zheng_wenlong --- doc/api-ref/html/d3/d3d/hs-helper_8h.html | 47 ++++++++++++------------ doc/api-ref/html/d3/d3d/hs-helper_8h_source.html | 19 +++++----- 2 files changed, 34 insertions(+), 32 deletions(-) (limited to 'doc/api-ref/html/d3/d3d') diff --git a/doc/api-ref/html/d3/d3d/hs-helper_8h.html b/doc/api-ref/html/d3/d3d/hs-helper_8h.html index 4937489..5ee78fe 100644 --- a/doc/api-ref/html/d3/d3d/hs-helper_8h.html +++ b/doc/api-ref/html/d3/d3d/hs-helper_8h.html @@ -5,7 +5,7 @@ -HomeScreenBinding: homescreen_service/hs-helper.h File Reference +HomeScreenBinding: src/hs-helper.h File Reference @@ -58,7 +58,7 @@ $(function() {
@@ -76,6 +76,7 @@ $(function() { #include <stdint.h>
#include <glib.h>
#include <errno.h>
+#include "hmi-debug.h"

Go to the source code of this file.

@@ -171,12 +172,12 @@ Variables
OUT_RANGE 
-

Definition at line 25 of file hs-helper.h.

-
26 {
27  REQ_FAIL = -1,
28  REQ_OK=0,
29  NOT_NUMBER,
30  OUT_RANGE
31 }REQ_ERROR;
- - - -
REQ_ERROR
Definition: hs-helper.h:25
+

Definition at line 26 of file hs-helper.h.

+
27 {
28  REQ_FAIL = -1,
29  REQ_OK=0,
30  NOT_NUMBER,
31  OUT_RANGE
32 }REQ_ERROR;
+ + + +
REQ_ERROR
Definition: hs-helper.h:26
@@ -214,10 +215,10 @@ Variables

Definition at line 48 of file hs-helper.c.

-
49 {
50  char* endptr;
51  const char* tmp = afb_req_value (request, source);
52  if(!tmp)
53  {
54  return REQ_FAIL;
55  }
56  long tmp_id = strtol(tmp,&endptr,10);
57 
58  /* error check of range */
59  if( (tmp_id > INT16_MAX) || (tmp_id < INT16_MIN) )
60  {
61  return OUT_RANGE;
62  }
63  if(*endptr != '\0')
64  {
65  return NOT_NUMBER;
66  }
67 
68  *out_id = (int16_t)tmp_id;
69  return REQ_OK;
70 }
- - - +
49 {
50  char* endptr;
51  const char* tmp = afb_req_value (request, source);
52  if(!tmp)
53  {
54  return REQ_FAIL;
55  }
56  long tmp_id = strtol(tmp,&endptr,10);
57 
58  /* error check of range */
59  if( (tmp_id > INT16_MAX) || (tmp_id < INT16_MIN) )
60  {
61  return OUT_RANGE;
62  }
63  if(*endptr != '\0')
64  {
65  return NOT_NUMBER;
66  }
67 
68  *out_id = (int16_t)tmp_id;
69  return REQ_OK;
70 }
+ + +
@@ -254,10 +255,10 @@ Variables

Definition at line 72 of file hs-helper.c.

-
73 {
74  char* endptr;
75  const char* tmp = afb_req_value (request, source);
76  if(!tmp)
77  {
78  return REQ_FAIL;
79  }
80  long tmp_id = strtol(tmp,&endptr,10);
81 
82  /* error check of range */
83  if( (tmp_id > INT32_MAX) || (tmp_id < INT32_MIN) )
84  {
85  return OUT_RANGE;
86  }
87  if(*endptr != '\0')
88  {
89  return NOT_NUMBER;
90  }
91 
92  *out_id = (int32_t)tmp_id;
93  return REQ_OK;
94 }
- - - +
73 {
74  char* endptr;
75  const char* tmp = afb_req_value (request, source);
76  if(!tmp)
77  {
78  return REQ_FAIL;
79  }
80  long tmp_id = strtol(tmp,&endptr,10);
81 
82  /* error check of range */
83  if( (tmp_id > INT32_MAX) || (tmp_id < INT32_MIN) )
84  {
85  return OUT_RANGE;
86  }
87  if(*endptr != '\0')
88  {
89  return NOT_NUMBER;
90  }
91 
92  *out_id = (int32_t)tmp_id;
93  return REQ_OK;
94 }
+ + +
@@ -294,10 +295,10 @@ Variables

Definition at line 24 of file hs-helper.c.

-
25 {
26  char* endptr;
27  const char* tmp = afb_req_value (request, source);
28  if(!tmp)
29  {
30  return REQ_FAIL;
31  }
32  long tmp_id = strtol(tmp,&endptr,10);
33 
34  /* error check of range */
35  if( (tmp_id > UINT16_MAX) || (tmp_id < 0) )
36  {
37  return OUT_RANGE;
38  }
39  if(*endptr != '\0')
40  {
41  return NOT_NUMBER;
42  }
43 
44  *out_id = (uint16_t)tmp_id;
45  return REQ_OK;
46 }
- - - +
25 {
26  char* endptr;
27  const char* tmp = afb_req_value (request, source);
28  if(!tmp)
29  {
30  return REQ_FAIL;
31  }
32  long tmp_id = strtol(tmp,&endptr,10);
33 
34  /* error check of range */
35  if( (tmp_id > UINT16_MAX) || (tmp_id < 0) )
36  {
37  return OUT_RANGE;
38  }
39  if(*endptr != '\0')
40  {
41  return NOT_NUMBER;
42  }
43 
44  *out_id = (uint16_t)tmp_id;
45  return REQ_OK;
46 }
+ + +
@@ -432,7 +433,7 @@ Variables

Definition at line 142 of file hs-helper.c.

-
143 {
144  size_t buf_size = 50;
145  size_t size = sizeof evlist / sizeof *evlist;
146  int ret = -1;
147  for(size_t i = 0 ; i < size ; ++i)
148  {
149  if(!strncmp(value, evlist[i], buf_size))
150  {
151  ret = i;
152  break;
153  }
154  }
155  return ret;
156 }
static const char * evlist[]
Definition: hs-helper.h:33
+
143 {
144  size_t buf_size = 50;
145  size_t size = sizeof evlist / sizeof *evlist;
146  int ret = -1;
147  for(size_t i = 0 ; i < size ; ++i)
148  {
149  if(!strncmp(value, evlist[i], buf_size))
150  {
151  ret = i;
152  break;
153  }
154  }
155  return ret;
156 }
static const char * evlist[]
Definition: hs-helper.h:34
@@ -456,8 +457,8 @@ Variables
-Initial value:
= {
"tap_shortcut",
"on_screen_message",
"reserved"
}
-

Definition at line 33 of file hs-helper.h.

+Initial value:
= {
"tap_shortcut",
"on_screen_message",
"on_screen_reply",
"reserved"
}
+

Definition at line 34 of file hs-helper.h.

diff --git a/doc/api-ref/html/d3/d3d/hs-helper_8h_source.html b/doc/api-ref/html/d3/d3d/hs-helper_8h_source.html index 84f32cf..f0a581a 100644 --- a/doc/api-ref/html/d3/d3d/hs-helper_8h_source.html +++ b/doc/api-ref/html/d3/d3d/hs-helper_8h_source.html @@ -5,7 +5,7 @@ -HomeScreenBinding: homescreen_service/hs-helper.h Source File +HomeScreenBinding: src/hs-helper.h Source File @@ -58,7 +58,7 @@ $(function() {
@@ -66,18 +66,19 @@ $(function() {
hs-helper.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 HOMESCREEN_HELPER_H
18 #define HOMESCREEN_HELPER_H
19 #define AFB_BINDING_VERSION 2
20 #include <afb/afb-binding.h>
21 #include <stdint.h>
22 #include <glib.h>
23 #include <errno.h>
24 
25 typedef enum REQ_ERROR
26 {
27  REQ_FAIL = -1,
28  REQ_OK=0,
31 }REQ_ERROR;
32 
33 static const char* evlist[] = {
34  "tap_shortcut",
35  "on_screen_message",
36  "reserved"
37  };
38 
39 REQ_ERROR get_value_uint16(const struct afb_req request, const char *source, uint16_t *out_id);
40 REQ_ERROR get_value_int16(const struct afb_req request, const char *source, int16_t *out_id);
41 REQ_ERROR get_value_int32(const struct afb_req request, const char *source, int32_t *out_id);
42 void hs_add_object_to_json_object(struct json_object* j_obj, int count, ...);
43 void hs_add_object_to_json_object_str(struct json_object* j_obj, int count, ...);
44 void hs_add_object_to_json_object_func(struct json_object* j_obj, const char* verb_name, int count, ...);
45 int hs_search_event_name_index(const char* value);
46 
47 #endif /*HOMESCREEN_HELPER_H*/
void hs_add_object_to_json_object_func(struct json_object *j_obj, const char *verb_name, int count,...)
Definition: hs-helper.c:125
+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 HOMESCREEN_HELPER_H
18 #define HOMESCREEN_HELPER_H
19 #define AFB_BINDING_VERSION 2
20 #include <afb/afb-binding.h>
21 #include <stdint.h>
22 #include <glib.h>
23 #include <errno.h>
24 #include "hmi-debug.h"
25 
26 typedef enum REQ_ERROR
27 {
28  REQ_FAIL = -1,
29  REQ_OK=0,
32 }REQ_ERROR;
33 
34 static const char* evlist[] = {
35  "tap_shortcut",
36  "on_screen_message",
37  "on_screen_reply",
38  "reserved"
39  };
40 
41 REQ_ERROR get_value_uint16(const struct afb_req request, const char *source, uint16_t *out_id);
42 REQ_ERROR get_value_int16(const struct afb_req request, const char *source, int16_t *out_id);
43 REQ_ERROR get_value_int32(const struct afb_req request, const char *source, int32_t *out_id);
44 void hs_add_object_to_json_object(struct json_object* j_obj, int count, ...);
45 void hs_add_object_to_json_object_str(struct json_object* j_obj, int count, ...);
46 void hs_add_object_to_json_object_func(struct json_object* j_obj, const char* verb_name, int count, ...);
47 int hs_search_event_name_index(const char* value);
48 
49 #endif /*HOMESCREEN_HELPER_H*/
void hs_add_object_to_json_object_func(struct json_object *j_obj, const char *verb_name, int count,...)
Definition: hs-helper.c:125
REQ_ERROR get_value_uint16(const struct afb_req request, const char *source, uint16_t *out_id)
Definition: hs-helper.c:24
void hs_add_object_to_json_object(struct json_object *j_obj, int count,...)
Definition: hs-helper.c:96
REQ_ERROR get_value_int32(const struct afb_req request, const char *source, int32_t *out_id)
Definition: hs-helper.c:72
REQ_ERROR get_value_int16(const struct afb_req request, const char *source, int16_t *out_id)
Definition: hs-helper.c:48
int hs_search_event_name_index(const char *value)
Definition: hs-helper.c:142
-
static const char * evlist[]
Definition: hs-helper.h:33
- - - - -
REQ_ERROR
Definition: hs-helper.h:25
+
static const char * evlist[]
Definition: hs-helper.h:34
+ + + + +
REQ_ERROR
Definition: hs-helper.h:26
+
void hs_add_object_to_json_object_str(struct json_object *j_obj, int count,...)
Definition: hs-helper.c:110
-- cgit 1.2.3-korg