Add a new OnScreenReply api to agl-service-homescreen
[apps/agl-service-homescreen.git] / doc / api-ref / latex / d0 / d8a / libhomescreen_8cpp.tex
1 \hypertarget{libhomescreen_8cpp}{}\section{libhomescreen/libhomescreen.cpp File Reference}
2 \label{libhomescreen_8cpp}\index{libhomescreen/libhomescreen.\+cpp@{libhomescreen/libhomescreen.\+cpp}}
3 {\ttfamily \#include $<$stdarg.\+h$>$}\newline
4 {\ttfamily \#include $<$sys/socket.\+h$>$}\newline
5 {\ttfamily \#include $<$iostream$>$}\newline
6 {\ttfamily \#include $<$algorithm$>$}\newline
7 {\ttfamily \#include $<$thread$>$}\newline
8 {\ttfamily \#include $<$errno.\+h$>$}\newline
9 {\ttfamily \#include $<$cassert$>$}\newline
10 {\ttfamily \#include $<$cctype$>$}\newline
11 {\ttfamily \#include $<$cerrno$>$}\newline
12 {\ttfamily \#include $<$cstdio$>$}\newline
13 {\ttfamily \#include $<$cstdlib$>$}\newline
14 {\ttfamily \#include $<$cstring$>$}\newline
15 {\ttfamily \#include $<$libhomescreen.\+hpp$>$}\newline
16 {\ttfamily \#include \char`\"{}hmi-\/debug.\+h\char`\"{}}\newline
17 \subsection*{Functions}
18 \begin{DoxyCompactItemize}
19 \item 
20 static bool \hyperlink{libhomescreen_8cpp_a7a2176c3d71fec0f09dcb2aa0866b17e}{has\+\_\+verb} (const string \&verb)
21 \item 
22 static void \hyperlink{libhomescreen_8cpp_a73c05b96c151e5e46c28585ccb143c1c}{\+\_\+on\+\_\+hangup\+\_\+static} (void $\ast$closure, struct afb\+\_\+wsj1 $\ast$wsj)
23 \item 
24 static void \hyperlink{libhomescreen_8cpp_a782a05fde0f1c17e0c4c8f972a3f53c8}{\+\_\+on\+\_\+call\+\_\+static} (void $\ast$closure, const char $\ast$api, const char $\ast$verb, struct afb\+\_\+wsj1\+\_\+msg $\ast$msg)
25 \item 
26 static void \hyperlink{libhomescreen_8cpp_a3df86185aa9453726556da201d95a6f9}{\+\_\+on\+\_\+event\+\_\+static} (void $\ast$closure, const char $\ast$\hyperlink{structevent}{event}, struct afb\+\_\+wsj1\+\_\+msg $\ast$msg)
27 \item 
28 static void \hyperlink{libhomescreen_8cpp_a7778933bffa862c63fa0a1b8219faa8b}{\+\_\+on\+\_\+reply\+\_\+static} (void $\ast$closure, struct afb\+\_\+wsj1\+\_\+msg $\ast$msg)
29 \item 
30 static void $\ast$ \hyperlink{libhomescreen_8cpp_aa73353e1bf62c68b6b0aba7a1e4e275e}{event\+\_\+loop\+\_\+run} (void $\ast$args)
31 \end{DoxyCompactItemize}
32 \subsection*{Variables}
33 \begin{DoxyCompactItemize}
34 \item 
35 static const char \hyperlink{libhomescreen_8cpp_a1e2d6e77dd8f0162f830058579eab42f}{A\+PI} \mbox{[}$\,$\mbox{]} = \char`\"{}homescreen\char`\"{}
36 \end{DoxyCompactItemize}
37
38
39 \subsection{Function Documentation}
40 \mbox{\Hypertarget{libhomescreen_8cpp_a782a05fde0f1c17e0c4c8f972a3f53c8}\label{libhomescreen_8cpp_a782a05fde0f1c17e0c4c8f972a3f53c8}} 
41 \index{libhomescreen.\+cpp@{libhomescreen.\+cpp}!\+\_\+on\+\_\+call\+\_\+static@{\+\_\+on\+\_\+call\+\_\+static}}
42 \index{\+\_\+on\+\_\+call\+\_\+static@{\+\_\+on\+\_\+call\+\_\+static}!libhomescreen.\+cpp@{libhomescreen.\+cpp}}
43 \subsubsection{\texorpdfstring{\+\_\+on\+\_\+call\+\_\+static()}{\_on\_call\_static()}}
44 {\footnotesize\ttfamily static void \+\_\+on\+\_\+call\+\_\+static (\begin{DoxyParamCaption}\item[{void $\ast$}]{closure,  }\item[{const char $\ast$}]{api,  }\item[{const char $\ast$}]{verb,  }\item[{struct afb\+\_\+wsj1\+\_\+msg $\ast$}]{msg }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}
45
46
47
48 Definition at line 64 of file libhomescreen.\+cpp.
49
50
51 \begin{DoxyCode}
52 65 \{
53 66     \textcolor{comment}{/* LibHomeScreen is not called from other process */}
54 67 \}
55 \end{DoxyCode}
56 \mbox{\Hypertarget{libhomescreen_8cpp_a3df86185aa9453726556da201d95a6f9}\label{libhomescreen_8cpp_a3df86185aa9453726556da201d95a6f9}} 
57 \index{libhomescreen.\+cpp@{libhomescreen.\+cpp}!\+\_\+on\+\_\+event\+\_\+static@{\+\_\+on\+\_\+event\+\_\+static}}
58 \index{\+\_\+on\+\_\+event\+\_\+static@{\+\_\+on\+\_\+event\+\_\+static}!libhomescreen.\+cpp@{libhomescreen.\+cpp}}
59 \subsubsection{\texorpdfstring{\+\_\+on\+\_\+event\+\_\+static()}{\_on\_event\_static()}}
60 {\footnotesize\ttfamily static void \+\_\+on\+\_\+event\+\_\+static (\begin{DoxyParamCaption}\item[{void $\ast$}]{closure,  }\item[{const char $\ast$}]{event,  }\item[{struct afb\+\_\+wsj1\+\_\+msg $\ast$}]{msg }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}
61
62
63
64 Definition at line 69 of file libhomescreen.\+cpp.
65
66
67 \begin{DoxyCode}
68 70 \{
69 71     \textcolor{keyword}{static\_cast<}\hyperlink{class_lib_home_screen}{LibHomeScreen}*\textcolor{keyword}{>}(closure)->on\_event(NULL,\hyperlink{structevent}{event},msg);
70 72 \}
71 \end{DoxyCode}
72 \mbox{\Hypertarget{libhomescreen_8cpp_a73c05b96c151e5e46c28585ccb143c1c}\label{libhomescreen_8cpp_a73c05b96c151e5e46c28585ccb143c1c}} 
73 \index{libhomescreen.\+cpp@{libhomescreen.\+cpp}!\+\_\+on\+\_\+hangup\+\_\+static@{\+\_\+on\+\_\+hangup\+\_\+static}}
74 \index{\+\_\+on\+\_\+hangup\+\_\+static@{\+\_\+on\+\_\+hangup\+\_\+static}!libhomescreen.\+cpp@{libhomescreen.\+cpp}}
75 \subsubsection{\texorpdfstring{\+\_\+on\+\_\+hangup\+\_\+static()}{\_on\_hangup\_static()}}
76 {\footnotesize\ttfamily static void \+\_\+on\+\_\+hangup\+\_\+static (\begin{DoxyParamCaption}\item[{void $\ast$}]{closure,  }\item[{struct afb\+\_\+wsj1 $\ast$}]{wsj }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}
77
78 websocket 
79
80 Definition at line 59 of file libhomescreen.\+cpp.
81
82
83 \begin{DoxyCode}
84 60 \{
85 61     \textcolor{keyword}{static\_cast<}\hyperlink{class_lib_home_screen}{LibHomeScreen}*\textcolor{keyword}{>}(closure)->on\_hangup(NULL,wsj);
86 62 \}
87 \end{DoxyCode}
88 \mbox{\Hypertarget{libhomescreen_8cpp_a7778933bffa862c63fa0a1b8219faa8b}\label{libhomescreen_8cpp_a7778933bffa862c63fa0a1b8219faa8b}} 
89 \index{libhomescreen.\+cpp@{libhomescreen.\+cpp}!\+\_\+on\+\_\+reply\+\_\+static@{\+\_\+on\+\_\+reply\+\_\+static}}
90 \index{\+\_\+on\+\_\+reply\+\_\+static@{\+\_\+on\+\_\+reply\+\_\+static}!libhomescreen.\+cpp@{libhomescreen.\+cpp}}
91 \subsubsection{\texorpdfstring{\+\_\+on\+\_\+reply\+\_\+static()}{\_on\_reply\_static()}}
92 {\footnotesize\ttfamily static void \+\_\+on\+\_\+reply\+\_\+static (\begin{DoxyParamCaption}\item[{void $\ast$}]{closure,  }\item[{struct afb\+\_\+wsj1\+\_\+msg $\ast$}]{msg }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}
93
94
95
96 Definition at line 74 of file libhomescreen.\+cpp.
97
98
99 \begin{DoxyCode}
100 75 \{
101 76     \textcolor{keyword}{static\_cast<}\hyperlink{class_lib_home_screen}{LibHomeScreen}*\textcolor{keyword}{>}(closure)->on\_reply(NULL,msg);
102 77 \}
103 \end{DoxyCode}
104 \mbox{\Hypertarget{libhomescreen_8cpp_aa73353e1bf62c68b6b0aba7a1e4e275e}\label{libhomescreen_8cpp_aa73353e1bf62c68b6b0aba7a1e4e275e}} 
105 \index{libhomescreen.\+cpp@{libhomescreen.\+cpp}!event\+\_\+loop\+\_\+run@{event\+\_\+loop\+\_\+run}}
106 \index{event\+\_\+loop\+\_\+run@{event\+\_\+loop\+\_\+run}!libhomescreen.\+cpp@{libhomescreen.\+cpp}}
107 \subsubsection{\texorpdfstring{event\+\_\+loop\+\_\+run()}{event\_loop\_run()}}
108 {\footnotesize\ttfamily static void$\ast$ event\+\_\+loop\+\_\+run (\begin{DoxyParamCaption}\item[{void $\ast$}]{args }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}
109
110
111
112 Definition at line 201 of file libhomescreen.\+cpp.
113
114
115 \begin{DoxyCode}
116 202 \{
117 203     \textcolor{keyword}{struct }sd\_event* loop = (\textcolor{keyword}{struct }sd\_event*)(args);
118 204     \hyperlink{hmi-debug_8h_a0d26d8b8201011dade787236519711c0}{HMI\_DEBUG}(\textcolor{stringliteral}{"libhomescreen"},\textcolor{stringliteral}{"start eventloop"});
119 205     \textcolor{keywordflow}{for}(;;)
120 206         sd\_event\_run(loop, 30000000);
121 207 \}
122 \end{DoxyCode}
123 \mbox{\Hypertarget{libhomescreen_8cpp_a7a2176c3d71fec0f09dcb2aa0866b17e}\label{libhomescreen_8cpp_a7a2176c3d71fec0f09dcb2aa0866b17e}} 
124 \index{libhomescreen.\+cpp@{libhomescreen.\+cpp}!has\+\_\+verb@{has\+\_\+verb}}
125 \index{has\+\_\+verb@{has\+\_\+verb}!libhomescreen.\+cpp@{libhomescreen.\+cpp}}
126 \subsubsection{\texorpdfstring{has\+\_\+verb()}{has\_verb()}}
127 {\footnotesize\ttfamily static bool has\+\_\+verb (\begin{DoxyParamCaption}\item[{const string \&}]{verb }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}
128
129
130
131 Definition at line 518 of file libhomescreen.\+cpp.
132
133
134 \begin{DoxyCode}
135 519 \{
136 520     \hyperlink{hmi-debug_8h_a0d26d8b8201011dade787236519711c0}{HMI\_DEBUG}(\textcolor{stringliteral}{"libhomescreen"},\textcolor{stringliteral}{"verb is %s"}, verb.c\_str());
137 521     \textcolor{keywordflow}{if}(find(\hyperlink{class_lib_home_screen_a5593ff5ac78f6495ccb649904cf0ab08}{LibHomeScreen::api\_list}.begin(), 
138       \hyperlink{class_lib_home_screen_a5593ff5ac78f6495ccb649904cf0ab08}{LibHomeScreen::api\_list}.end(), verb) != 
139       \hyperlink{class_lib_home_screen_a5593ff5ac78f6495ccb649904cf0ab08}{LibHomeScreen::api\_list}.end())
140 522         \textcolor{keywordflow}{return} \textcolor{keyword}{true};
141 523     \textcolor{keywordflow}{else}
142 524         \textcolor{keywordflow}{return} \textcolor{keyword}{false};
143 525 \}
144 \end{DoxyCode}
145
146
147 \subsection{Variable Documentation}
148 \mbox{\Hypertarget{libhomescreen_8cpp_a1e2d6e77dd8f0162f830058579eab42f}\label{libhomescreen_8cpp_a1e2d6e77dd8f0162f830058579eab42f}} 
149 \index{libhomescreen.\+cpp@{libhomescreen.\+cpp}!A\+PI@{A\+PI}}
150 \index{A\+PI@{A\+PI}!libhomescreen.\+cpp@{libhomescreen.\+cpp}}
151 \subsubsection{\texorpdfstring{A\+PI}{API}}
152 {\footnotesize\ttfamily const char A\+PI\mbox{[}$\,$\mbox{]} = \char`\"{}homescreen\char`\"{}\hspace{0.3cm}{\ttfamily [static]}}
153
154
155
156 Definition at line 36 of file libhomescreen.\+cpp.
157