1 \hypertarget{homescreen_8c}{}\section{src/homescreen.c File Reference}
2 \label{homescreen_8c}\index{src/homescreen.\+c@{src/homescreen.\+c}}
3 {\ttfamily \#include $<$afb/afb-\/binding.\+h$>$}\newline
4 {\ttfamily \#include $<$stdio.\+h$>$}\newline
5 {\ttfamily \#include $<$string.\+h$>$}\newline
6 {\ttfamily \#include $<$stdlib.\+h$>$}\newline
7 {\ttfamily \#include $<$stdint.\+h$>$}\newline
8 {\ttfamily \#include $<$unistd.\+h$>$}\newline
9 {\ttfamily \#include $<$json-\/c/json.\+h$>$}\newline
10 {\ttfamily \#include $<$glib.\+h$>$}\newline
11 {\ttfamily \#include $<$pthread.\+h$>$}\newline
12 {\ttfamily \#include \char`\"{}hs-\/helper.\+h\char`\"{}}\newline
14 \begin{DoxyCompactItemize}
16 struct \hyperlink{structevent}{event}
17 \end{DoxyCompactItemize}
19 \begin{DoxyCompactItemize}
21 \#define \hyperlink{homescreen_8c_a369266c24eacffb87046522897a570d5}{\+\_\+\+G\+N\+U\+\_\+\+S\+O\+U\+R\+CE}
23 \#define \hyperlink{homescreen_8c_ad2c1fbc92ba364fcf83f15e6d0af66f0}{A\+F\+B\+\_\+\+B\+I\+N\+D\+I\+N\+G\+\_\+\+V\+E\+R\+S\+I\+ON}~2
25 \#define \hyperlink{homescreen_8c_a09f43d9e7e1c5d2198c0d66024b4500e}{C\+O\+M\+M\+A\+N\+D\+\_\+\+E\+V\+E\+N\+T\+\_\+\+N\+UM}~4
27 \#define \hyperlink{homescreen_8c_a9a68ed04201d9390bb85b2c6ab1d7250}{E\+V\+E\+N\+T\+\_\+\+S\+U\+B\+S\+C\+R\+I\+B\+E\+\_\+\+E\+R\+R\+O\+R\+\_\+\+C\+O\+DE}~100
28 \end{DoxyCompactItemize}
29 \subsection*{Functions}
30 \begin{DoxyCompactItemize}
32 static void \hyperlink{homescreen_8c_af48cab759d4ae0ddbfcdd60f4051ba05}{ping\+Sample} (struct afb\+\_\+req request)
34 static void \hyperlink{homescreen_8c_a096eae5c8f297f9df142a406eea56227}{tap\+\_\+shortcut} (struct afb\+\_\+req request)
36 static void \hyperlink{homescreen_8c_a640cf8ed97d804c5ed1c09a349056338}{on\+\_\+screen\+\_\+message} (struct afb\+\_\+req request)
38 static void \hyperlink{homescreen_8c_a2f380055d7d69828115d2a8951634933}{on\+\_\+screen\+\_\+reply} (struct afb\+\_\+req request)
40 static void \hyperlink{homescreen_8c_a4ff0c8b506669e5622a6ee168134d8f1}{subscribe} (struct afb\+\_\+req request)
42 static void \hyperlink{homescreen_8c_ab92621255d7370c6dd8a0f1a8e376ad3}{unsubscribe} (struct afb\+\_\+req request)
44 static int \hyperlink{homescreen_8c_a83d646edf54a6a082f69121bc89a08de}{preinit} ()
46 static int \hyperlink{homescreen_8c_a00cbbc0f3f4452db078ae511684a6adc}{init} ()
48 static void \hyperlink{homescreen_8c_a1279893c0fe937311a81e0a98fb4cf1c}{onevent} (const char $\ast$\hyperlink{structevent}{event}, struct json\+\_\+object $\ast$object)
49 \end{DoxyCompactItemize}
50 \subsection*{Variables}
51 \begin{DoxyCompactItemize}
53 static struct \hyperlink{structevent}{event} \hyperlink{homescreen_8c_a1c3c5bfa861dcb58d9e9d216d893864c}{event\+\_\+list} \mbox{[}\hyperlink{homescreen_8c_a09f43d9e7e1c5d2198c0d66024b4500e}{C\+O\+M\+M\+A\+N\+D\+\_\+\+E\+V\+E\+N\+T\+\_\+\+N\+UM}\mbox{]}
55 static struct afb\+\_\+event \hyperlink{homescreen_8c_a2af1ff5a4cbf03125e61e903832035f5}{ev\+\_\+tap\+\_\+shortcut}
57 static struct afb\+\_\+event \hyperlink{homescreen_8c_af7cfc4f688bb898c09291252c4cb832c}{ev\+\_\+on\+\_\+screen\+\_\+message}
59 static struct afb\+\_\+event \hyperlink{homescreen_8c_a5c225341e0ecbae0585302ef754a55ec}{ev\+\_\+on\+\_\+screen\+\_\+reply}
61 static struct afb\+\_\+event \hyperlink{homescreen_8c_a25fbdcc4e5787e3f41d99f4a71e86611}{ev\+\_\+reserved}
63 static const char \hyperlink{homescreen_8c_aed1c5296a2e6d34945507a0fca17a376}{\+\_\+error} \mbox{[}$\,$\mbox{]} = \char`\"{}error\char`\"{}
65 static const char \hyperlink{homescreen_8c_a1f2c79fa6801b63751e270d67994fe81}{\+\_\+application\+\_\+name} \mbox{[}$\,$\mbox{]} = \char`\"{}application\+\_\+name\char`\"{}
67 static const char \hyperlink{homescreen_8c_abfd6c1d6f316fa952b11553f8f275e92}{\+\_\+display\+\_\+message} \mbox{[}$\,$\mbox{]} = \char`\"{}display\+\_\+message\char`\"{}
69 static const char \hyperlink{homescreen_8c_a79b0f0b481161527ccb80e83da143219}{\+\_\+reply\+\_\+message} \mbox{[}$\,$\mbox{]} = \char`\"{}reply\+\_\+message\char`\"{}
71 static const struct afb\+\_\+verb\+\_\+v2 \hyperlink{homescreen_8c_acad6dadf60fac3d701e488e4fcd11c89}{verbs} \mbox{[}$\,$\mbox{]}
73 const struct afb\+\_\+binding\+\_\+v2 \hyperlink{homescreen_8c_ae2a62ab481a2922cbfc788193857a12e}{afb\+Binding\+V2}
74 \end{DoxyCompactItemize}
77 \subsection{Macro Definition Documentation}
78 \mbox{\Hypertarget{homescreen_8c_a369266c24eacffb87046522897a570d5}\label{homescreen_8c_a369266c24eacffb87046522897a570d5}}
79 \index{homescreen.\+c@{homescreen.\+c}!\+\_\+\+G\+N\+U\+\_\+\+S\+O\+U\+R\+CE@{\+\_\+\+G\+N\+U\+\_\+\+S\+O\+U\+R\+CE}}
80 \index{\+\_\+\+G\+N\+U\+\_\+\+S\+O\+U\+R\+CE@{\+\_\+\+G\+N\+U\+\_\+\+S\+O\+U\+R\+CE}!homescreen.\+c@{homescreen.\+c}}
81 \subsubsection{\texorpdfstring{\+\_\+\+G\+N\+U\+\_\+\+S\+O\+U\+R\+CE}{\_GNU\_SOURCE}}
82 {\footnotesize\ttfamily \#define \+\_\+\+G\+N\+U\+\_\+\+S\+O\+U\+R\+CE}
86 Definition at line 17 of file homescreen.\+c.
88 \mbox{\Hypertarget{homescreen_8c_ad2c1fbc92ba364fcf83f15e6d0af66f0}\label{homescreen_8c_ad2c1fbc92ba364fcf83f15e6d0af66f0}}
89 \index{homescreen.\+c@{homescreen.\+c}!A\+F\+B\+\_\+\+B\+I\+N\+D\+I\+N\+G\+\_\+\+V\+E\+R\+S\+I\+ON@{A\+F\+B\+\_\+\+B\+I\+N\+D\+I\+N\+G\+\_\+\+V\+E\+R\+S\+I\+ON}}
90 \index{A\+F\+B\+\_\+\+B\+I\+N\+D\+I\+N\+G\+\_\+\+V\+E\+R\+S\+I\+ON@{A\+F\+B\+\_\+\+B\+I\+N\+D\+I\+N\+G\+\_\+\+V\+E\+R\+S\+I\+ON}!homescreen.\+c@{homescreen.\+c}}
91 \subsubsection{\texorpdfstring{A\+F\+B\+\_\+\+B\+I\+N\+D\+I\+N\+G\+\_\+\+V\+E\+R\+S\+I\+ON}{AFB\_BINDING\_VERSION}}
92 {\footnotesize\ttfamily \#define A\+F\+B\+\_\+\+B\+I\+N\+D\+I\+N\+G\+\_\+\+V\+E\+R\+S\+I\+ON~2}
96 Definition at line 18 of file homescreen.\+c.
98 \mbox{\Hypertarget{homescreen_8c_a09f43d9e7e1c5d2198c0d66024b4500e}\label{homescreen_8c_a09f43d9e7e1c5d2198c0d66024b4500e}}
99 \index{homescreen.\+c@{homescreen.\+c}!C\+O\+M\+M\+A\+N\+D\+\_\+\+E\+V\+E\+N\+T\+\_\+\+N\+UM@{C\+O\+M\+M\+A\+N\+D\+\_\+\+E\+V\+E\+N\+T\+\_\+\+N\+UM}}
100 \index{C\+O\+M\+M\+A\+N\+D\+\_\+\+E\+V\+E\+N\+T\+\_\+\+N\+UM@{C\+O\+M\+M\+A\+N\+D\+\_\+\+E\+V\+E\+N\+T\+\_\+\+N\+UM}!homescreen.\+c@{homescreen.\+c}}
101 \subsubsection{\texorpdfstring{C\+O\+M\+M\+A\+N\+D\+\_\+\+E\+V\+E\+N\+T\+\_\+\+N\+UM}{COMMAND\_EVENT\_NUM}}
102 {\footnotesize\ttfamily \#define C\+O\+M\+M\+A\+N\+D\+\_\+\+E\+V\+E\+N\+T\+\_\+\+N\+UM~4}
106 Definition at line 31 of file homescreen.\+c.
108 \mbox{\Hypertarget{homescreen_8c_a9a68ed04201d9390bb85b2c6ab1d7250}\label{homescreen_8c_a9a68ed04201d9390bb85b2c6ab1d7250}}
109 \index{homescreen.\+c@{homescreen.\+c}!E\+V\+E\+N\+T\+\_\+\+S\+U\+B\+S\+C\+R\+I\+B\+E\+\_\+\+E\+R\+R\+O\+R\+\_\+\+C\+O\+DE@{E\+V\+E\+N\+T\+\_\+\+S\+U\+B\+S\+C\+R\+I\+B\+E\+\_\+\+E\+R\+R\+O\+R\+\_\+\+C\+O\+DE}}
110 \index{E\+V\+E\+N\+T\+\_\+\+S\+U\+B\+S\+C\+R\+I\+B\+E\+\_\+\+E\+R\+R\+O\+R\+\_\+\+C\+O\+DE@{E\+V\+E\+N\+T\+\_\+\+S\+U\+B\+S\+C\+R\+I\+B\+E\+\_\+\+E\+R\+R\+O\+R\+\_\+\+C\+O\+DE}!homescreen.\+c@{homescreen.\+c}}
111 \subsubsection{\texorpdfstring{E\+V\+E\+N\+T\+\_\+\+S\+U\+B\+S\+C\+R\+I\+B\+E\+\_\+\+E\+R\+R\+O\+R\+\_\+\+C\+O\+DE}{EVENT\_SUBSCRIBE\_ERROR\_CODE}}
112 {\footnotesize\ttfamily \#define E\+V\+E\+N\+T\+\_\+\+S\+U\+B\+S\+C\+R\+I\+B\+E\+\_\+\+E\+R\+R\+O\+R\+\_\+\+C\+O\+DE~100}
116 Definition at line 32 of file homescreen.\+c.
120 \subsection{Function Documentation}
121 \mbox{\Hypertarget{homescreen_8c_a00cbbc0f3f4452db078ae511684a6adc}\label{homescreen_8c_a00cbbc0f3f4452db078ae511684a6adc}}
122 \index{homescreen.\+c@{homescreen.\+c}!init@{init}}
123 \index{init@{init}!homescreen.\+c@{homescreen.\+c}}
124 \subsubsection{\texorpdfstring{init()}{init()}}
125 {\footnotesize\ttfamily static int init (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}
129 Definition at line 277 of file homescreen.\+c.
134 279 \hyperlink{hmi-debug_8h_abc0d6e0760017d8ae48b836925b2ef15}{HMI\_NOTICE}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"binding init"});
136 281 \hyperlink{homescreen_8c_a2af1ff5a4cbf03125e61e903832035f5}{ev\_tap\_shortcut} = afb\_daemon\_make\_event(\hyperlink{hs-helper_8h_a0cd84b1a2184c9b84d1b7bf24582f28e}{evlist}[0]);
137 282 \hyperlink{homescreen_8c_af7cfc4f688bb898c09291252c4cb832c}{ev\_on\_screen\_message} = afb\_daemon\_make\_event(\hyperlink{hs-helper_8h_a0cd84b1a2184c9b84d1b7bf24582f28e}{evlist}[1]);
138 283 \hyperlink{homescreen_8c_a5c225341e0ecbae0585302ef754a55ec}{ev\_on\_screen\_reply} = afb\_daemon\_make\_event(\hyperlink{hs-helper_8h_a0cd84b1a2184c9b84d1b7bf24582f28e}{evlist}[2]);
139 284 \hyperlink{homescreen_8c_a25fbdcc4e5787e3f41d99f4a71e86611}{ev\_reserved} = afb\_daemon\_make\_event(\hyperlink{hs-helper_8h_a0cd84b1a2184c9b84d1b7bf24582f28e}{evlist}[3]);
141 286 \hyperlink{homescreen_8c_a1c3c5bfa861dcb58d9e9d216d893864c}{event\_list}[0].\hyperlink{structevent_a45c6cfb7961a21a3366db067e4cc59ab}{name} = \hyperlink{hs-helper_8h_a0cd84b1a2184c9b84d1b7bf24582f28e}{evlist}[0];
142 287 \hyperlink{homescreen_8c_a1c3c5bfa861dcb58d9e9d216d893864c}{event\_list}[0].\hyperlink{structevent_a58726ebc551d36562ac3f9e1fe293214}{event} = &\hyperlink{homescreen_8c_a2af1ff5a4cbf03125e61e903832035f5}{ev\_tap\_shortcut};
144 289 \hyperlink{homescreen_8c_a1c3c5bfa861dcb58d9e9d216d893864c}{event\_list}[1].\hyperlink{structevent_a45c6cfb7961a21a3366db067e4cc59ab}{name} = \hyperlink{hs-helper_8h_a0cd84b1a2184c9b84d1b7bf24582f28e}{evlist}[1];
145 290 \hyperlink{homescreen_8c_a1c3c5bfa861dcb58d9e9d216d893864c}{event\_list}[1].\hyperlink{structevent_a58726ebc551d36562ac3f9e1fe293214}{event} = &\hyperlink{homescreen_8c_af7cfc4f688bb898c09291252c4cb832c}{ev\_on\_screen\_message};
147 292 \hyperlink{homescreen_8c_a1c3c5bfa861dcb58d9e9d216d893864c}{event\_list}[2].\hyperlink{structevent_a45c6cfb7961a21a3366db067e4cc59ab}{name} = \hyperlink{hs-helper_8h_a0cd84b1a2184c9b84d1b7bf24582f28e}{evlist}[2];
148 293 \hyperlink{homescreen_8c_a1c3c5bfa861dcb58d9e9d216d893864c}{event\_list}[2].\hyperlink{structevent_a58726ebc551d36562ac3f9e1fe293214}{event} = &\hyperlink{homescreen_8c_a5c225341e0ecbae0585302ef754a55ec}{ev\_on\_screen\_reply};
150 295 \hyperlink{homescreen_8c_a1c3c5bfa861dcb58d9e9d216d893864c}{event\_list}[3].\hyperlink{structevent_a45c6cfb7961a21a3366db067e4cc59ab}{name} = \hyperlink{hs-helper_8h_a0cd84b1a2184c9b84d1b7bf24582f28e}{evlist}[3];
151 296 \hyperlink{homescreen_8c_a1c3c5bfa861dcb58d9e9d216d893864c}{event\_list}[3].\hyperlink{structevent_a58726ebc551d36562ac3f9e1fe293214}{event} = &\hyperlink{homescreen_8c_a25fbdcc4e5787e3f41d99f4a71e86611}{ev\_reserved};
153 298 \textcolor{keywordflow}{return} 0;
156 \mbox{\Hypertarget{homescreen_8c_a640cf8ed97d804c5ed1c09a349056338}\label{homescreen_8c_a640cf8ed97d804c5ed1c09a349056338}}
157 \index{homescreen.\+c@{homescreen.\+c}!on\+\_\+screen\+\_\+message@{on\+\_\+screen\+\_\+message}}
158 \index{on\+\_\+screen\+\_\+message@{on\+\_\+screen\+\_\+message}!homescreen.\+c@{homescreen.\+c}}
159 \subsubsection{\texorpdfstring{on\+\_\+screen\+\_\+message()}{on\_screen\_message()}}
160 {\footnotesize\ttfamily static void on\+\_\+screen\+\_\+message (\begin{DoxyParamCaption}\item[{struct afb\+\_\+req}]{request }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}
162 Home\+Screen On\+Screen message
164 \subparagraph*{Parameters}
168 \item display\+\_\+message \+: message for display
171 \subparagraph*{Return}
175 Definition at line 114 of file homescreen.\+c.
180 116 \hyperlink{hmi-debug_8h_abc0d6e0760017d8ae48b836925b2ef15}{HMI\_NOTICE}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"is called."});
182 118 \textcolor{keywordtype}{int} ret = 0;
183 119 \textcolor{keyword}{const} \textcolor{keywordtype}{char}* value = afb\_req\_value(request, \hyperlink{homescreen_8c_abfd6c1d6f316fa952b11553f8f275e92}{\_display\_message});
184 120 \textcolor{keywordflow}{if} (value) \{
186 122 \hyperlink{hmi-debug_8h_abc0d6e0760017d8ae48b836925b2ef15}{HMI\_NOTICE}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"request params = %s."}, value);
188 124 \textcolor{keyword}{struct }json\_object* push\_obj = json\_object\_new\_object();
189 125 \hyperlink{hs-helper_8c_a8777c53f1d4d5412f19b134ad85ffedf}{hs\_add\_object\_to\_json\_object\_str}( push\_obj, 2,
190 126 \hyperlink{homescreen_8c_abfd6c1d6f316fa952b11553f8f275e92}{\_display\_message}, value);
191 127 afb\_event\_push(\hyperlink{homescreen_8c_af7cfc4f688bb898c09291252c4cb832c}{ev\_on\_screen\_message}, push\_obj);
192 128 \} \textcolor{keywordflow}{else} \{
193 129 afb\_req\_fail\_f(request, \textcolor{stringliteral}{"failed"}, \textcolor{stringliteral}{"called %s, Unknown palameter"}, \_\_FUNCTION\_\_);
194 130 \textcolor{keywordflow}{return};
197 133 \textcolor{comment}{// response to HomeScreen}
198 134 \textcolor{keyword}{struct }json\_object *res = json\_object\_new\_object();
199 135 \hyperlink{hs-helper_8c_ae83604a37134e7bdee3ce4f10bb0b47a}{hs\_add\_object\_to\_json\_object\_func}(res, \_\_FUNCTION\_\_, 2,
200 136 \hyperlink{homescreen_8c_aed1c5296a2e6d34945507a0fca17a376}{\_error}, ret);
201 137 afb\_req\_success(request, res, \textcolor{stringliteral}{"afb\_event\_push event [on\_screen\_message]"});
204 \mbox{\Hypertarget{homescreen_8c_a2f380055d7d69828115d2a8951634933}\label{homescreen_8c_a2f380055d7d69828115d2a8951634933}}
205 \index{homescreen.\+c@{homescreen.\+c}!on\+\_\+screen\+\_\+reply@{on\+\_\+screen\+\_\+reply}}
206 \index{on\+\_\+screen\+\_\+reply@{on\+\_\+screen\+\_\+reply}!homescreen.\+c@{homescreen.\+c}}
207 \subsubsection{\texorpdfstring{on\+\_\+screen\+\_\+reply()}{on\_screen\_reply()}}
208 {\footnotesize\ttfamily static void on\+\_\+screen\+\_\+reply (\begin{DoxyParamCaption}\item[{struct afb\+\_\+req}]{request }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}
210 Home\+Screen On\+Screen Reply
212 \subparagraph*{Parameters}
216 \item reply\+\_\+message \+: message for reply
219 \subparagraph*{Return}
223 Definition at line 151 of file homescreen.\+c.
228 153 \hyperlink{hmi-debug_8h_abc0d6e0760017d8ae48b836925b2ef15}{HMI\_NOTICE}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"is called."});
230 155 \textcolor{keywordtype}{int} ret = 0;
231 156 \textcolor{keyword}{const} \textcolor{keywordtype}{char}* value = afb\_req\_value(request, \hyperlink{homescreen_8c_a79b0f0b481161527ccb80e83da143219}{\_reply\_message});
232 157 \textcolor{keywordflow}{if} (value) \{
234 159 \hyperlink{hmi-debug_8h_abc0d6e0760017d8ae48b836925b2ef15}{HMI\_NOTICE}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"request params = %s."}, value);
236 161 \textcolor{keyword}{struct }json\_object* push\_obj = json\_object\_new\_object();
237 162 \hyperlink{hs-helper_8c_a8777c53f1d4d5412f19b134ad85ffedf}{hs\_add\_object\_to\_json\_object\_str}( push\_obj, 2,
238 163 \hyperlink{homescreen_8c_a79b0f0b481161527ccb80e83da143219}{\_reply\_message}, value);
239 164 afb\_event\_push(\hyperlink{homescreen_8c_a5c225341e0ecbae0585302ef754a55ec}{ev\_on\_screen\_reply}, push\_obj);
240 165 \} \textcolor{keywordflow}{else} \{
241 166 afb\_req\_fail\_f(request, \textcolor{stringliteral}{"failed"}, \textcolor{stringliteral}{"called %s, Unknown palameter"}, \_\_FUNCTION\_\_);
242 167 \textcolor{keywordflow}{return};
245 170 \textcolor{comment}{// response to HomeScreen}
246 171 \textcolor{keyword}{struct }json\_object *res = json\_object\_new\_object();
247 172 \hyperlink{hs-helper_8c_ae83604a37134e7bdee3ce4f10bb0b47a}{hs\_add\_object\_to\_json\_object\_func}(res, \_\_FUNCTION\_\_, 2,
248 173 \hyperlink{homescreen_8c_aed1c5296a2e6d34945507a0fca17a376}{\_error}, ret);
249 174 afb\_req\_success(request, res, \textcolor{stringliteral}{"afb\_event\_push event [on\_screen\_reply]"});
252 \mbox{\Hypertarget{homescreen_8c_a1279893c0fe937311a81e0a98fb4cf1c}\label{homescreen_8c_a1279893c0fe937311a81e0a98fb4cf1c}}
253 \index{homescreen.\+c@{homescreen.\+c}!onevent@{onevent}}
254 \index{onevent@{onevent}!homescreen.\+c@{homescreen.\+c}}
255 \subsubsection{\texorpdfstring{onevent()}{onevent()}}
256 {\footnotesize\ttfamily static void onevent (\begin{DoxyParamCaption}\item[{const char $\ast$}]{event, }\item[{struct json\+\_\+object $\ast$}]{object }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}
260 Definition at line 301 of file homescreen.\+c.
265 303 \hyperlink{hmi-debug_8h_abc0d6e0760017d8ae48b836925b2ef15}{HMI\_NOTICE}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"on\_event %s"}, \hyperlink{structevent}{event});
268 \mbox{\Hypertarget{homescreen_8c_af48cab759d4ae0ddbfcdd60f4051ba05}\label{homescreen_8c_af48cab759d4ae0ddbfcdd60f4051ba05}}
269 \index{homescreen.\+c@{homescreen.\+c}!ping\+Sample@{ping\+Sample}}
270 \index{ping\+Sample@{ping\+Sample}!homescreen.\+c@{homescreen.\+c}}
271 \subsubsection{\texorpdfstring{ping\+Sample()}{pingSample()}}
272 {\footnotesize\ttfamily static void ping\+Sample (\begin{DoxyParamCaption}\item[{struct afb\+\_\+req}]{request }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}
276 Definition at line 57 of file homescreen.\+c.
281 59 \textcolor{keyword}{static} \textcolor{keywordtype}{int} pingcount = 0;
282 60 afb\_req\_success\_f(request, json\_object\_new\_int(pingcount), \textcolor{stringliteral}{"Ping count = %d"}, pingcount);
283 61 \hyperlink{hmi-debug_8h_abc0d6e0760017d8ae48b836925b2ef15}{HMI\_NOTICE}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"Verbosity macro at level notice invoked at ping invocation
284 count = %d"}, pingcount);
288 \mbox{\Hypertarget{homescreen_8c_a83d646edf54a6a082f69121bc89a08de}\label{homescreen_8c_a83d646edf54a6a082f69121bc89a08de}}
289 \index{homescreen.\+c@{homescreen.\+c}!preinit@{preinit}}
290 \index{preinit@{preinit}!homescreen.\+c@{homescreen.\+c}}
291 \subsubsection{\texorpdfstring{preinit()}{preinit()}}
292 {\footnotesize\ttfamily static int preinit (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}
296 Definition at line 271 of file homescreen.\+c.
301 273 \hyperlink{hmi-debug_8h_abc0d6e0760017d8ae48b836925b2ef15}{HMI\_NOTICE}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"binding preinit (was register)"});
302 274 \textcolor{keywordflow}{return} 0;
305 \mbox{\Hypertarget{homescreen_8c_a4ff0c8b506669e5622a6ee168134d8f1}\label{homescreen_8c_a4ff0c8b506669e5622a6ee168134d8f1}}
306 \index{homescreen.\+c@{homescreen.\+c}!subscribe@{subscribe}}
307 \index{subscribe@{subscribe}!homescreen.\+c@{homescreen.\+c}}
308 \subsubsection{\texorpdfstring{subscribe()}{subscribe()}}
309 {\footnotesize\ttfamily static void subscribe (\begin{DoxyParamCaption}\item[{struct afb\+\_\+req}]{request }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}
313 \subparagraph*{Parameters}
317 \item event \+: Event name. Event list is written in \hyperlink{libhomescreen_8cpp}{libhomescreen.\+cpp}
320 \subparagraph*{Return}
326 Definition at line 189 of file homescreen.\+c.
331 191 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *value = afb\_req\_value(request, \textcolor{stringliteral}{"event"});
332 192 \hyperlink{hmi-debug_8h_abc0d6e0760017d8ae48b836925b2ef15}{HMI\_NOTICE}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"value is %s"}, value);
333 193 \textcolor{keywordtype}{int} ret = 0;
334 194 \textcolor{keywordflow}{if}(value) \{
335 195 \textcolor{keywordtype}{int} index = \hyperlink{hs-helper_8c_a2ff1b894941c3b461ca8119079c4146a}{hs\_search\_event\_name\_index}(value);
336 196 \textcolor{keywordflow}{if}(index < 0)
338 198 \hyperlink{hmi-debug_8h_abc0d6e0760017d8ae48b836925b2ef15}{HMI\_NOTICE}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"dedicated event doesn't exist"});
339 199 ret = \hyperlink{homescreen_8c_a9a68ed04201d9390bb85b2c6ab1d7250}{EVENT\_SUBSCRIBE\_ERROR\_CODE};
341 201 \textcolor{keywordflow}{else}
343 203 afb\_req\_subscribe(request, *\hyperlink{homescreen_8c_a1c3c5bfa861dcb58d9e9d216d893864c}{event\_list}[index].\hyperlink{structevent}{event});
346 206 \textcolor{keywordflow}{else}\{
347 207 \hyperlink{hmi-debug_8h_abc0d6e0760017d8ae48b836925b2ef15}{HMI\_NOTICE}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"Please input event name"});
348 208 ret = \hyperlink{homescreen_8c_a9a68ed04201d9390bb85b2c6ab1d7250}{EVENT\_SUBSCRIBE\_ERROR\_CODE};
350 210 \textcolor{comment}{/*create response json object*/}
351 211 \textcolor{keyword}{struct }json\_object *res = json\_object\_new\_object();
352 212 \hyperlink{hs-helper_8c_ae83604a37134e7bdee3ce4f10bb0b47a}{hs\_add\_object\_to\_json\_object\_func}(res, \_\_FUNCTION\_\_, 2,
353 213 \hyperlink{homescreen_8c_aed1c5296a2e6d34945507a0fca17a376}{\_error}, ret);
354 214 afb\_req\_success\_f(request, res, \textcolor{stringliteral}{"homescreen binder subscribe event name [%s]"}, value);
357 \mbox{\Hypertarget{homescreen_8c_a096eae5c8f297f9df142a406eea56227}\label{homescreen_8c_a096eae5c8f297f9df142a406eea56227}}
358 \index{homescreen.\+c@{homescreen.\+c}!tap\+\_\+shortcut@{tap\+\_\+shortcut}}
359 \index{tap\+\_\+shortcut@{tap\+\_\+shortcut}!homescreen.\+c@{homescreen.\+c}}
360 \subsubsection{\texorpdfstring{tap\+\_\+shortcut()}{tap\_shortcut()}}
361 {\footnotesize\ttfamily static void tap\+\_\+shortcut (\begin{DoxyParamCaption}\item[{struct afb\+\_\+req}]{request }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}
363 tap\+\_\+shortcut notify for homescreen When Shortcut area is tapped, notify these applciations
365 \subparagraph*{Parameters}
369 \item application\+\_\+name \+: application name
372 \subparagraph*{Return}
376 Definition at line 77 of file homescreen.\+c.
381 79 \hyperlink{hmi-debug_8h_abc0d6e0760017d8ae48b836925b2ef15}{HMI\_NOTICE}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"is called."});
383 81 \textcolor{keywordtype}{int} ret = 0;
384 82 \textcolor{keyword}{const} \textcolor{keywordtype}{char}* value = afb\_req\_value(request, \hyperlink{homescreen_8c_a1f2c79fa6801b63751e270d67994fe81}{\_application\_name});
385 83 \textcolor{keywordflow}{if} (value) \{
387 85 \hyperlink{hmi-debug_8h_abc0d6e0760017d8ae48b836925b2ef15}{HMI\_NOTICE}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"request params = %s."}, value);
389 87 \textcolor{keyword}{struct }json\_object* push\_obj = json\_object\_new\_object();
390 88 \hyperlink{hs-helper_8c_a8777c53f1d4d5412f19b134ad85ffedf}{hs\_add\_object\_to\_json\_object\_str}( push\_obj, 2,
391 89 \hyperlink{homescreen_8c_a1f2c79fa6801b63751e270d67994fe81}{\_application\_name}, value);
392 90 afb\_event\_push(\hyperlink{homescreen_8c_a2af1ff5a4cbf03125e61e903832035f5}{ev\_tap\_shortcut}, push\_obj);
393 91 \} \textcolor{keywordflow}{else} \{
394 92 afb\_req\_fail\_f(request, \textcolor{stringliteral}{"failed"}, \textcolor{stringliteral}{"called %s, Unknown palameter"}, \_\_FUNCTION\_\_);
395 93 \textcolor{keywordflow}{return};
398 96 \textcolor{comment}{// response to HomeScreen}
399 97 \textcolor{keyword}{struct }json\_object *res = json\_object\_new\_object();
400 98 \hyperlink{hs-helper_8c_ae83604a37134e7bdee3ce4f10bb0b47a}{hs\_add\_object\_to\_json\_object\_func}(res, \_\_FUNCTION\_\_, 2,
401 99 \hyperlink{homescreen_8c_aed1c5296a2e6d34945507a0fca17a376}{\_error}, ret);
402 100 afb\_req\_success(request, res, \textcolor{stringliteral}{"afb\_event\_push event [tap\_shortcut]"});
405 \mbox{\Hypertarget{homescreen_8c_ab92621255d7370c6dd8a0f1a8e376ad3}\label{homescreen_8c_ab92621255d7370c6dd8a0f1a8e376ad3}}
406 \index{homescreen.\+c@{homescreen.\+c}!unsubscribe@{unsubscribe}}
407 \index{unsubscribe@{unsubscribe}!homescreen.\+c@{homescreen.\+c}}
408 \subsubsection{\texorpdfstring{unsubscribe()}{unsubscribe()}}
409 {\footnotesize\ttfamily static void unsubscribe (\begin{DoxyParamCaption}\item[{struct afb\+\_\+req}]{request }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}
413 \subparagraph*{Parameters}
417 \item event \+: Event name. Event list is written in \hyperlink{libhomescreen_8cpp}{libhomescreen.\+cpp}
420 \subparagraph*{Return}
426 Definition at line 229 of file homescreen.\+c.
431 231 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *value = afb\_req\_value(request, \textcolor{stringliteral}{"event"});
432 232 \hyperlink{hmi-debug_8h_abc0d6e0760017d8ae48b836925b2ef15}{HMI\_NOTICE}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"value is %s"}, value);
433 233 \textcolor{keywordtype}{int} ret = 0;
434 234 \textcolor{keywordflow}{if}(value) \{
435 235 \textcolor{keywordtype}{int} index = \hyperlink{hs-helper_8c_a2ff1b894941c3b461ca8119079c4146a}{hs\_search\_event\_name\_index}(value);
436 236 \textcolor{keywordflow}{if}(index < 0)
438 238 \hyperlink{hmi-debug_8h_abc0d6e0760017d8ae48b836925b2ef15}{HMI\_NOTICE}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"dedicated event doesn't exist"});
439 239 ret = \hyperlink{homescreen_8c_a9a68ed04201d9390bb85b2c6ab1d7250}{EVENT\_SUBSCRIBE\_ERROR\_CODE};
441 241 \textcolor{keywordflow}{else}
443 243 afb\_req\_unsubscribe(request, *\hyperlink{homescreen_8c_a1c3c5bfa861dcb58d9e9d216d893864c}{event\_list}[index].\hyperlink{structevent}{event});
446 246 \textcolor{keywordflow}{else}\{
447 247 \hyperlink{hmi-debug_8h_abc0d6e0760017d8ae48b836925b2ef15}{HMI\_NOTICE}(\textcolor{stringliteral}{"homescreen-service"},\textcolor{stringliteral}{"Please input event name"});
448 248 ret = \hyperlink{homescreen_8c_a9a68ed04201d9390bb85b2c6ab1d7250}{EVENT\_SUBSCRIBE\_ERROR\_CODE};
450 250 \textcolor{comment}{/*create response json object*/}
451 251 \textcolor{keyword}{struct }json\_object *res = json\_object\_new\_object();
452 252 \hyperlink{hs-helper_8c_ae83604a37134e7bdee3ce4f10bb0b47a}{hs\_add\_object\_to\_json\_object\_func}(res, \_\_FUNCTION\_\_, 2,
453 253 \hyperlink{homescreen_8c_aed1c5296a2e6d34945507a0fca17a376}{\_error}, ret);
454 254 afb\_req\_success\_f(request, res, \textcolor{stringliteral}{"homescreen binder unsubscribe event name [%s]"}, value);
459 \subsection{Variable Documentation}
460 \mbox{\Hypertarget{homescreen_8c_a1f2c79fa6801b63751e270d67994fe81}\label{homescreen_8c_a1f2c79fa6801b63751e270d67994fe81}}
461 \index{homescreen.\+c@{homescreen.\+c}!\+\_\+application\+\_\+name@{\+\_\+application\+\_\+name}}
462 \index{\+\_\+application\+\_\+name@{\+\_\+application\+\_\+name}!homescreen.\+c@{homescreen.\+c}}
463 \subsubsection{\texorpdfstring{\+\_\+application\+\_\+name}{\_application\_name}}
464 {\footnotesize\ttfamily const char \+\_\+application\+\_\+name\mbox{[}$\,$\mbox{]} = \char`\"{}application\+\_\+name\char`\"{}\hspace{0.3cm}{\ttfamily [static]}}
468 Definition at line 49 of file homescreen.\+c.
470 \mbox{\Hypertarget{homescreen_8c_abfd6c1d6f316fa952b11553f8f275e92}\label{homescreen_8c_abfd6c1d6f316fa952b11553f8f275e92}}
471 \index{homescreen.\+c@{homescreen.\+c}!\+\_\+display\+\_\+message@{\+\_\+display\+\_\+message}}
472 \index{\+\_\+display\+\_\+message@{\+\_\+display\+\_\+message}!homescreen.\+c@{homescreen.\+c}}
473 \subsubsection{\texorpdfstring{\+\_\+display\+\_\+message}{\_display\_message}}
474 {\footnotesize\ttfamily const char \+\_\+display\+\_\+message\mbox{[}$\,$\mbox{]} = \char`\"{}display\+\_\+message\char`\"{}\hspace{0.3cm}{\ttfamily [static]}}
478 Definition at line 50 of file homescreen.\+c.
480 \mbox{\Hypertarget{homescreen_8c_aed1c5296a2e6d34945507a0fca17a376}\label{homescreen_8c_aed1c5296a2e6d34945507a0fca17a376}}
481 \index{homescreen.\+c@{homescreen.\+c}!\+\_\+error@{\+\_\+error}}
482 \index{\+\_\+error@{\+\_\+error}!homescreen.\+c@{homescreen.\+c}}
483 \subsubsection{\texorpdfstring{\+\_\+error}{\_error}}
484 {\footnotesize\ttfamily const char \+\_\+error\mbox{[}$\,$\mbox{]} = \char`\"{}error\char`\"{}\hspace{0.3cm}{\ttfamily [static]}}
488 Definition at line 47 of file homescreen.\+c.
490 \mbox{\Hypertarget{homescreen_8c_a79b0f0b481161527ccb80e83da143219}\label{homescreen_8c_a79b0f0b481161527ccb80e83da143219}}
491 \index{homescreen.\+c@{homescreen.\+c}!\+\_\+reply\+\_\+message@{\+\_\+reply\+\_\+message}}
492 \index{\+\_\+reply\+\_\+message@{\+\_\+reply\+\_\+message}!homescreen.\+c@{homescreen.\+c}}
493 \subsubsection{\texorpdfstring{\+\_\+reply\+\_\+message}{\_reply\_message}}
494 {\footnotesize\ttfamily const char \+\_\+reply\+\_\+message\mbox{[}$\,$\mbox{]} = \char`\"{}reply\+\_\+message\char`\"{}\hspace{0.3cm}{\ttfamily [static]}}
498 Definition at line 51 of file homescreen.\+c.
500 \mbox{\Hypertarget{homescreen_8c_ae2a62ab481a2922cbfc788193857a12e}\label{homescreen_8c_ae2a62ab481a2922cbfc788193857a12e}}
501 \index{homescreen.\+c@{homescreen.\+c}!afb\+Binding\+V2@{afb\+Binding\+V2}}
502 \index{afb\+Binding\+V2@{afb\+Binding\+V2}!homescreen.\+c@{homescreen.\+c}}
503 \subsubsection{\texorpdfstring{afb\+Binding\+V2}{afbBindingV2}}
504 {\footnotesize\ttfamily const struct afb\+\_\+binding\+\_\+v2 afb\+Binding\+V2}
506 {\bfseries Initial value\+:}
509 .api = \textcolor{stringliteral}{"homescreen"},
510 .specification = NULL,
511 .verbs = \hyperlink{homescreen_8c_acad6dadf60fac3d701e488e4fcd11c89}{verbs},
512 .preinit = \hyperlink{homescreen_8c_a83d646edf54a6a082f69121bc89a08de}{preinit},
513 .init = \hyperlink{homescreen_8c_a00cbbc0f3f4452db078ae511684a6adc}{init},
514 .onevent = \hyperlink{homescreen_8c_a1279893c0fe937311a81e0a98fb4cf1c}{onevent}
519 Definition at line 306 of file homescreen.\+c.
521 \mbox{\Hypertarget{homescreen_8c_af7cfc4f688bb898c09291252c4cb832c}\label{homescreen_8c_af7cfc4f688bb898c09291252c4cb832c}}
522 \index{homescreen.\+c@{homescreen.\+c}!ev\+\_\+on\+\_\+screen\+\_\+message@{ev\+\_\+on\+\_\+screen\+\_\+message}}
523 \index{ev\+\_\+on\+\_\+screen\+\_\+message@{ev\+\_\+on\+\_\+screen\+\_\+message}!homescreen.\+c@{homescreen.\+c}}
524 \subsubsection{\texorpdfstring{ev\+\_\+on\+\_\+screen\+\_\+message}{ev\_on\_screen\_message}}
525 {\footnotesize\ttfamily struct afb\+\_\+event ev\+\_\+on\+\_\+screen\+\_\+message\hspace{0.3cm}{\ttfamily [static]}}
529 Definition at line 43 of file homescreen.\+c.
531 \mbox{\Hypertarget{homescreen_8c_a5c225341e0ecbae0585302ef754a55ec}\label{homescreen_8c_a5c225341e0ecbae0585302ef754a55ec}}
532 \index{homescreen.\+c@{homescreen.\+c}!ev\+\_\+on\+\_\+screen\+\_\+reply@{ev\+\_\+on\+\_\+screen\+\_\+reply}}
533 \index{ev\+\_\+on\+\_\+screen\+\_\+reply@{ev\+\_\+on\+\_\+screen\+\_\+reply}!homescreen.\+c@{homescreen.\+c}}
534 \subsubsection{\texorpdfstring{ev\+\_\+on\+\_\+screen\+\_\+reply}{ev\_on\_screen\_reply}}
535 {\footnotesize\ttfamily struct afb\+\_\+event ev\+\_\+on\+\_\+screen\+\_\+reply\hspace{0.3cm}{\ttfamily [static]}}
539 Definition at line 44 of file homescreen.\+c.
541 \mbox{\Hypertarget{homescreen_8c_a25fbdcc4e5787e3f41d99f4a71e86611}\label{homescreen_8c_a25fbdcc4e5787e3f41d99f4a71e86611}}
542 \index{homescreen.\+c@{homescreen.\+c}!ev\+\_\+reserved@{ev\+\_\+reserved}}
543 \index{ev\+\_\+reserved@{ev\+\_\+reserved}!homescreen.\+c@{homescreen.\+c}}
544 \subsubsection{\texorpdfstring{ev\+\_\+reserved}{ev\_reserved}}
545 {\footnotesize\ttfamily struct afb\+\_\+event ev\+\_\+reserved\hspace{0.3cm}{\ttfamily [static]}}
549 Definition at line 45 of file homescreen.\+c.
551 \mbox{\Hypertarget{homescreen_8c_a2af1ff5a4cbf03125e61e903832035f5}\label{homescreen_8c_a2af1ff5a4cbf03125e61e903832035f5}}
552 \index{homescreen.\+c@{homescreen.\+c}!ev\+\_\+tap\+\_\+shortcut@{ev\+\_\+tap\+\_\+shortcut}}
553 \index{ev\+\_\+tap\+\_\+shortcut@{ev\+\_\+tap\+\_\+shortcut}!homescreen.\+c@{homescreen.\+c}}
554 \subsubsection{\texorpdfstring{ev\+\_\+tap\+\_\+shortcut}{ev\_tap\_shortcut}}
555 {\footnotesize\ttfamily struct afb\+\_\+event ev\+\_\+tap\+\_\+shortcut\hspace{0.3cm}{\ttfamily [static]}}
559 Definition at line 42 of file homescreen.\+c.
561 \mbox{\Hypertarget{homescreen_8c_a1c3c5bfa861dcb58d9e9d216d893864c}\label{homescreen_8c_a1c3c5bfa861dcb58d9e9d216d893864c}}
562 \index{homescreen.\+c@{homescreen.\+c}!event\+\_\+list@{event\+\_\+list}}
563 \index{event\+\_\+list@{event\+\_\+list}!homescreen.\+c@{homescreen.\+c}}
564 \subsubsection{\texorpdfstring{event\+\_\+list}{event\_list}}
565 {\footnotesize\ttfamily struct \hyperlink{structevent}{event} event\+\_\+list\mbox{[}\hyperlink{homescreen_8c_a09f43d9e7e1c5d2198c0d66024b4500e}{C\+O\+M\+M\+A\+N\+D\+\_\+\+E\+V\+E\+N\+T\+\_\+\+N\+UM}\mbox{]}\hspace{0.3cm}{\ttfamily [static]}}
569 Definition at line 40 of file homescreen.\+c.
571 \mbox{\Hypertarget{homescreen_8c_acad6dadf60fac3d701e488e4fcd11c89}\label{homescreen_8c_acad6dadf60fac3d701e488e4fcd11c89}}
572 \index{homescreen.\+c@{homescreen.\+c}!verbs@{verbs}}
573 \index{verbs@{verbs}!homescreen.\+c@{homescreen.\+c}}
574 \subsubsection{\texorpdfstring{verbs}{verbs}}
575 {\footnotesize\ttfamily const struct afb\+\_\+verb\+\_\+v2 verbs\mbox{[}$\,$\mbox{]}\hspace{0.3cm}{\ttfamily [static]}}
577 {\bfseries Initial value\+:}
581 \{ .verb = \textcolor{stringliteral}{"ping"}, .session = AFB\_SESSION\_NONE, .callback =
582 \hyperlink{homescreen_8c_af48cab759d4ae0ddbfcdd60f4051ba05}{pingSample}, .auth = NULL \},
583 \{ .verb = \textcolor{stringliteral}{"tap\_shortcut"}, .session = AFB\_SESSION\_NONE, .callback =
584 \hyperlink{homescreen_8c_a096eae5c8f297f9df142a406eea56227}{tap\_shortcut}, .auth = NULL \},
585 \{ .verb = \textcolor{stringliteral}{"on\_screen\_message"}, .session = AFB\_SESSION\_NONE, .callback =
586 \hyperlink{homescreen_8c_a640cf8ed97d804c5ed1c09a349056338}{on\_screen\_message}, .auth = NULL \},
587 \{ .verb = \textcolor{stringliteral}{"on\_screen\_reply"}, .session = AFB\_SESSION\_NONE, .callback =
588 \hyperlink{homescreen_8c_a2f380055d7d69828115d2a8951634933}{on\_screen\_reply}, .auth = NULL \},
589 \{ .verb = \textcolor{stringliteral}{"subscribe"}, .session = AFB\_SESSION\_NONE, .callback =
590 \hyperlink{homescreen_8c_a4ff0c8b506669e5622a6ee168134d8f1}{subscribe}, .auth = NULL \},
591 \{ .verb = \textcolor{stringliteral}{"unsubscribe"}, .session = AFB\_SESSION\_NONE, .callback =
592 \hyperlink{homescreen_8c_ab92621255d7370c6dd8a0f1a8e376ad3}{unsubscribe}, .auth = NULL \},
598 Definition at line 260 of file homescreen.\+c.