le_voicecall_common.h

Go to the documentation of this file.
1 
2 /*
3  * ====================== WARNING ======================
4  *
5  * THE CONTENTS OF THIS FILE HAVE BEEN AUTO-GENERATED.
6  * DO NOT MODIFY IN ANY WAY.
7  *
8  * ====================== WARNING ======================
9  */
10 /**
11  * @file le_voicecall_common.h
12  *
13  * Type definitions for le_voicecall.
14  *
15  */
16 #ifndef LE_VOICECALL_COMMON_H_INCLUDE_GUARD
17 #define LE_VOICECALL_COMMON_H_INCLUDE_GUARD
18 
19 
20 #include "legato.h"
21 
22 // Interface specific includes
23 #include "le_mdmDefs_common.h"
24 #include "le_audio_common.h"
25 
26 #define IFGEN_LE_VOICECALL_PROTOCOL_ID "181e5028027647a1335449aaac136e5c"
27 #define IFGEN_LE_VOICECALL_MSG_SIZE 37
28 /** @addtogroup le_voicecall
29  * @{ **/
30 
31 
32 //--------------------------------------------------------------------------------------------------
33 /**
34  * Reference returned by Start function and used by End function
35  */
36 //--------------------------------------------------------------------------------------------------
37 typedef struct le_voicecall_Call* le_voicecall_CallRef_t;
38 
39 
40 //--------------------------------------------------------------------------------------------------
41 /**
42  * Voice call establishment states.
43  */
44 //--------------------------------------------------------------------------------------------------
45 typedef enum
46 {
48  ///< Voice call establishment in progress.
49  ///< Far end is now alerting its user (outgoing call).
51  ///< Call has been established, and is media is active.
53  ///< Call has terminated.
55  ///< NO Service available to try establish a voice call.
57  ///< Remote party (callee) is busy.
59  ///< All local connection resources (lines/channels) are in use.
61  ///< Call ending failed.
63  ///< Call answering failed.
65  ///< Incoming voice call in progress.
66 }
68 
69 
70 //--------------------------------------------------------------------------------------------------
71 /**
72  * Voice call termination reason.
73  */
74 //--------------------------------------------------------------------------------------------------
75 typedef enum
76 {
78  ///< Network could not complete the call.
80  ///< Remote address could not be resolved.
82  ///< Caller is currently busy and cannot take the call.
84  ///< Local party ended the call.
86  ///< Remote party ended the call.
88  ///< Undefined reason.
89 }
91 
92 
93 //--------------------------------------------------------------------------------------------------
94 /**
95  * Reference type used by Add/Remove functions for EVENT 'le_voicecall_State'
96  */
97 //--------------------------------------------------------------------------------------------------
98 typedef struct le_voicecall_StateHandler* le_voicecall_StateHandlerRef_t;
99 
100 
101 //--------------------------------------------------------------------------------------------------
102 /**
103  * Handler for voice call state changes.
104  */
105 //--------------------------------------------------------------------------------------------------
106 typedef void (*le_voicecall_StateHandlerFunc_t)
107 (
108  le_voicecall_CallRef_t reference,
109  ///< Event voice call object reference.
110  const char* LE_NONNULL identifier,
111  ///< Identifier of the remote party
112  ///< associated with the call.
113  le_voicecall_Event_t event,
114  ///< Voice call event.
115  void* contextPtr
116  ///<
117 );
118 
119 
120 //--------------------------------------------------------------------------------------------------
121 /**
122  * Get if this client bound locally.
123  */
124 //--------------------------------------------------------------------------------------------------
125 LE_SHARED bool ifgen_le_voicecall_HasLocalBinding
126 (
127  void
128 );
129 
130 
131 //--------------------------------------------------------------------------------------------------
132 /**
133  * Init data that is common across all threads
134  */
135 //--------------------------------------------------------------------------------------------------
136 LE_SHARED void ifgen_le_voicecall_InitCommonData
137 (
138  void
139 );
140 
141 
142 //--------------------------------------------------------------------------------------------------
143 /**
144  * Perform common initialization and open a session
145  */
146 //--------------------------------------------------------------------------------------------------
147 LE_SHARED le_result_t ifgen_le_voicecall_OpenSession
148 (
149  le_msg_SessionRef_t _ifgen_sessionRef,
150  bool isBlocking
151 );
152 
153 //--------------------------------------------------------------------------------------------------
154 /**
155  * Add handler function for EVENT 'le_voicecall_State'
156  *
157  * This event provides information on voice call state changes
158  *
159  */
160 //--------------------------------------------------------------------------------------------------
161 LE_SHARED le_voicecall_StateHandlerRef_t ifgen_le_voicecall_AddStateHandler
162 (
163  le_msg_SessionRef_t _ifgen_sessionRef,
165  ///< [IN]
166  void* contextPtr
167  ///< [IN]
168 );
169 
170 //--------------------------------------------------------------------------------------------------
171 /**
172  * Remove handler function for EVENT 'le_voicecall_State'
173  */
174 //--------------------------------------------------------------------------------------------------
175 LE_SHARED void ifgen_le_voicecall_RemoveStateHandler
176 (
177  le_msg_SessionRef_t _ifgen_sessionRef,
179  ///< [IN]
180 );
181 
182 //--------------------------------------------------------------------------------------------------
183 /**
184  * Start a voice call.
185  *
186  * @return
187  * - Reference to the voice call (to be used later for releasing the voice call)
188  * - NULL if the voice call could not be processed
189  */
190 //--------------------------------------------------------------------------------------------------
191 LE_SHARED le_voicecall_CallRef_t ifgen_le_voicecall_Start
192 (
193  le_msg_SessionRef_t _ifgen_sessionRef,
194  const char* LE_NONNULL DestinationID
195  ///< [IN] Destination identifier for the voice
196  ///< call establishment.
197 );
198 
199 //--------------------------------------------------------------------------------------------------
200 /**
201  * Release a voice call.
202  *
203  * @return
204  * - LE_OK if the end of voice call can be processed.
205  * - LE_NOT_FOUND if the voice call object reference is not found.
206  */
207 //--------------------------------------------------------------------------------------------------
208 LE_SHARED le_result_t ifgen_le_voicecall_End
209 (
210  le_msg_SessionRef_t _ifgen_sessionRef,
211  le_voicecall_CallRef_t reference
212  ///< [IN] Voice call object reference to hang-up.
213 );
214 
215 //--------------------------------------------------------------------------------------------------
216 /**
217  * Delete voice call object reference create by le_voicecall_Start() or an incoming voice call.
218  *
219  * @return
220  * - LE_OK if the delete of voice call can be processed.
221  * - LE_FAULT if the voice call is not terminated.
222  * - LE_NOT_FOUND if the voice call object reference is not found.
223  */
224 //--------------------------------------------------------------------------------------------------
225 LE_SHARED le_result_t ifgen_le_voicecall_Delete
226 (
227  le_msg_SessionRef_t _ifgen_sessionRef,
228  le_voicecall_CallRef_t reference
229  ///< [IN] Voice call object reference to delete.
230 );
231 
232 //--------------------------------------------------------------------------------------------------
233 /**
234  * Answer to incoming voice call.
235  *
236  * @return
237  * - LE_OK if the incoming voice call can be answered
238  * - LE_NOT_FOUND if the incoming voice call object reference is not found.
239  */
240 //--------------------------------------------------------------------------------------------------
241 LE_SHARED le_result_t ifgen_le_voicecall_Answer
242 (
243  le_msg_SessionRef_t _ifgen_sessionRef,
244  le_voicecall_CallRef_t reference
245  ///< [IN] Incoming voice call object reference to answer.
246 );
247 
248 //--------------------------------------------------------------------------------------------------
249 /**
250  * Get the termination reason of a voice call reference.
251  *
252  * @return
253  * - LE_OK if the termination reason is got
254  * - LE_NOT_FOUND if the incoming voice call object reference is not found.
255  * - LE_FAULT if the voice call is not terminated.
256  */
257 //--------------------------------------------------------------------------------------------------
258 LE_SHARED le_result_t ifgen_le_voicecall_GetTerminationReason
259 (
260  le_msg_SessionRef_t _ifgen_sessionRef,
261  le_voicecall_CallRef_t reference,
262  ///< [IN] Voice call object reference to read from.
264  ///< [OUT] Termination reason of the voice call.
265 );
266 
267 //--------------------------------------------------------------------------------------------------
268 /**
269  * Called to get the transmitted audio stream. All audio generated on this
270  * end of the call is sent on this stream.
271  *
272  * @return Transmitted audio stream reference.
273  */
274 //--------------------------------------------------------------------------------------------------
275 LE_SHARED le_audio_StreamRef_t ifgen_le_voicecall_GetTxAudioStream
276 (
277  le_msg_SessionRef_t _ifgen_sessionRef,
278  le_voicecall_CallRef_t reference
279  ///< [IN] Voice call object reference to read from.
280 );
281 
282 //--------------------------------------------------------------------------------------------------
283 /**
284  * Called to get the received audio stream. All audio received from the
285  * other end of the call is received on this stream.
286  *
287  * @return Received audio stream reference.
288  */
289 //--------------------------------------------------------------------------------------------------
290 LE_SHARED le_audio_StreamRef_t ifgen_le_voicecall_GetRxAudioStream
291 (
292  le_msg_SessionRef_t _ifgen_sessionRef,
293  le_voicecall_CallRef_t reference
294  ///< [IN] Voice call object reference to read from.
295 );
296 /** @} **/
297 #endif // LE_VOICECALL_COMMON_H_INCLUDE_GUARD
#define LE_SHARED
Definition: le_basics.h:287
le_voicecall_TerminationReason_t
Definition: le_voicecall_common.h:75
le_result_t
Definition: le_basics.h:46
All local connection resources (lines/channels) are in use.
Definition: le_voicecall_common.h:58
void(* le_voicecall_StateHandlerFunc_t)(le_voicecall_CallRef_t reference, const char *LE_NONNULL identifier, le_voicecall_Event_t event, void *contextPtr)
Definition: le_voicecall_common.h:107
Call has terminated.
Definition: le_voicecall_common.h:52
le_voicecall_Event_t
Definition: le_voicecall_common.h:45
Caller is currently busy and cannot take the call.
Definition: le_voicecall_common.h:81
Incoming voice call in progress.
Definition: le_voicecall_common.h:64
Remote party (callee) is busy.
Definition: le_voicecall_common.h:56
Undefined reason.
Definition: le_voicecall_common.h:87
Remote address could not be resolved.
Definition: le_voicecall_common.h:79
struct le_msg_Session * le_msg_SessionRef_t
Definition: le_messaging.h:860
Network could not complete the call.
Definition: le_voicecall_common.h:77
Definition: le_voicecall_common.h:47
Call answering failed.
Definition: le_voicecall_common.h:62
struct le_audio_Stream * le_audio_StreamRef_t
Definition: le_audio_common.h:191
struct le_voicecall_Call * le_voicecall_CallRef_t
Definition: le_voicecall_common.h:37
Call ending failed.
Definition: le_voicecall_common.h:60
NO Service available to try establish a voice call.
Definition: le_voicecall_common.h:54
Local party ended the call.
Definition: le_voicecall_common.h:83
Remote party ended the call.
Definition: le_voicecall_common.h:85
struct le_voicecall_StateHandler * le_voicecall_StateHandlerRef_t
Definition: le_voicecall_common.h:98
Call has been established, and is media is active.
Definition: le_voicecall_common.h:50