le_rsim_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_rsim_common.h
12  *
13  * Type definitions for le_rsim.
14  *
15  */
16 #ifndef LE_RSIM_COMMON_H_INCLUDE_GUARD
17 #define LE_RSIM_COMMON_H_INCLUDE_GUARD
18 
19 
20 #include "legato.h"
21 
22 #define IFGEN_LE_RSIM_PROTOCOL_ID "fc5d30bf61a6dbc103fc71fe31db3559"
23 #define IFGEN_LE_RSIM_MSG_SIZE 1040
24 /** @addtogroup le_rsim
25  * @{ **/
26 
27 
28 //--------------------------------------------------------------------------------------------------
29 /**
30  * Remote SIM maximal message size
31  */
32 //--------------------------------------------------------------------------------------------------
33 #define LE_RSIM_MAX_MSG_SIZE 1024
34 
35 //--------------------------------------------------------------------------------------------------
36 /**
37  ** Remote SIM minimal message size
38  **
39  ** @note
40  ** This minimal length is set to ensure that the communication with the remote SIM server
41  ** can be effective.
42  */
43 //--------------------------------------------------------------------------------------------------
44 #define LE_RSIM_MIN_MSG_SIZE 200
45 
46 //--------------------------------------------------------------------------------------------------
47 /**
48  * Reference type used by Add/Remove functions for EVENT 'le_rsim_Message'
49  */
50 //--------------------------------------------------------------------------------------------------
51 typedef struct le_rsim_MessageHandler* le_rsim_MessageHandlerRef_t;
52 
53 
54 //--------------------------------------------------------------------------------------------------
55 /**
56  * Handler for message notification
57  */
58 //--------------------------------------------------------------------------------------------------
59 typedef void (*le_rsim_MessageHandlerFunc_t)
60 (
61  const uint8_t* messagePtr,
62  ///< Message to notify
63  size_t messageSize,
64  ///<
65  void* contextPtr
66  ///<
67 );
68 
69 //--------------------------------------------------------------------------------------------------
70 /**
71  * Handler for message sending result
72  */
73 //--------------------------------------------------------------------------------------------------
74 typedef void (*le_rsim_CallbackHandlerFunc_t)
75 (
76  uint8_t messageId,
77  ///< Message identifier
78  le_result_t result,
79  ///< Sending result
80  void* contextPtr
81  ///<
82 );
83 
84 
85 //--------------------------------------------------------------------------------------------------
86 /**
87  * Get if this client bound locally.
88  */
89 //--------------------------------------------------------------------------------------------------
90 LE_SHARED bool ifgen_le_rsim_HasLocalBinding
91 (
92  void
93 );
94 
95 
96 //--------------------------------------------------------------------------------------------------
97 /**
98  * Init data that is common across all threads
99  */
100 //--------------------------------------------------------------------------------------------------
101 LE_SHARED void ifgen_le_rsim_InitCommonData
102 (
103  void
104 );
105 
106 
107 //--------------------------------------------------------------------------------------------------
108 /**
109  * Perform common initialization and open a session
110  */
111 //--------------------------------------------------------------------------------------------------
112 LE_SHARED le_result_t ifgen_le_rsim_OpenSession
113 (
114  le_msg_SessionRef_t _ifgen_sessionRef,
115  bool isBlocking
116 );
117 
118 //--------------------------------------------------------------------------------------------------
119 /**
120  * Add handler function for EVENT 'le_rsim_Message'
121  *
122  * This event is used to notify and send a message
123  */
124 //--------------------------------------------------------------------------------------------------
125 LE_SHARED le_rsim_MessageHandlerRef_t ifgen_le_rsim_AddMessageHandler
126 (
127  le_msg_SessionRef_t _ifgen_sessionRef,
128  le_rsim_MessageHandlerFunc_t handlerPtr,
129  ///< [IN]
130  void* contextPtr
131  ///< [IN]
132 );
133 
134 //--------------------------------------------------------------------------------------------------
135 /**
136  * Remove handler function for EVENT 'le_rsim_Message'
137  */
138 //--------------------------------------------------------------------------------------------------
139 LE_SHARED void ifgen_le_rsim_RemoveMessageHandler
140 (
141  le_msg_SessionRef_t _ifgen_sessionRef,
142  le_rsim_MessageHandlerRef_t handlerRef
143  ///< [IN]
144 );
145 
146 //--------------------------------------------------------------------------------------------------
147 /**
148  * This function is called by the application to send a message to the Legato remote SIM service
149  *
150  * @return
151  * - LE_OK Function succeeded
152  * - LE_BAD_PARAMETER Message is too long
153  *
154  * @warning The sending process is asynchronous: only the message length is checked by this function
155  * before returning a result. A callback function should be passed as a parameter in order to be
156  * notified of the message sending result.
157  */
158 //--------------------------------------------------------------------------------------------------
159 LE_SHARED le_result_t ifgen_le_rsim_SendMessage
160 (
161  le_msg_SessionRef_t _ifgen_sessionRef,
162  const uint8_t* messagePtr,
163  ///< [IN] Message to send
164  size_t messageSize,
165  ///< [IN]
166  le_rsim_CallbackHandlerFunc_t callbackPtr,
167  ///< [IN] Callback for sending result
168  void* contextPtr
169  ///< [IN]
170 );
171 /** @} **/
172 #endif // LE_RSIM_COMMON_H_INCLUDE_GUARD
struct le_rsim_MessageHandler * le_rsim_MessageHandlerRef_t
Definition: le_rsim_common.h:51
#define LE_SHARED
Definition: le_basics.h:300
le_result_t
Definition: le_basics.h:46
void(* le_rsim_CallbackHandlerFunc_t)(uint8_t messageId, le_result_t result, void *contextPtr)
Definition: le_rsim_common.h:75
void(* le_rsim_MessageHandlerFunc_t)(const uint8_t *messagePtr, size_t messageSize, void *contextPtr)
Definition: le_rsim_common.h:60
struct le_msg_Session * le_msg_SessionRef_t
Definition: le_messaging.h:860