5
5
#ifndef __RIL_H__
6
6
#define __RIL_H__
7
7
8
- #ifndef _DOXYGEN_
9
- #ifndef FALSE
10
- #define FALSE 0
11
- #endif
12
-
13
- #ifndef TRUE
14
- #define TRUE 1
15
- #endif
8
+ #include <stdint.h>
16
9
17
- #ifndef NULL
18
- #define NULL ((void *) 0)
10
+ #ifdef __cplusplus
11
+ extern "C"
12
+ {
19
13
#endif
20
14
21
15
#define RIL_MAX_URC_PREFIX_LEN 50 /**< Maximum allowed URC keyword length */
22
16
#define PHONE_NUMBER_MAX_LEN 41 /**< Maximum phone number length */
23
17
24
- typedef unsigned char u8 ;
25
- typedef signed char s8 ;
26
- typedef unsigned short u16 ;
27
- typedef short s16 ;
28
- typedef unsigned int u32 ;
29
- typedef int s32 ;
30
- typedef unsigned long long u64 ;
31
- typedef long long s64 ;
32
- typedef unsigned int ticks ;
33
- #endif
34
-
35
18
/**
36
19
* System Initialization status
37
20
*/
@@ -151,14 +134,20 @@ enum ril_rc_e {
151
134
RIL_AT_UNINITIALIZED = -5 ,/**< RIL is not initialized */
152
135
};
153
136
137
+ /**
138
+ * Incoming call type
139
+ */
140
+ enum ril_calltype_e {
141
+ MD_VOICE_CALL_TYPE_VOICE ,/**< Voice call */
142
+ MD_VOICE_CALL_TYPE_VIDEO /**< Video call */
143
+ };
144
+
154
145
/**
155
146
* Incoming call phone info
156
147
*/
157
- struct callinfo_t {
158
- s32 type ; /**< Type of address with following possible values.\n
159
- 129: Unknown type (ISDN format number)\n
160
- 145: International number type (ISDN format) */
161
- char phoneNumber [PHONE_NUMBER_MAX_LEN ]; /**< Phone number as null terminated string */
148
+ struct ril_callinfo_t {
149
+ int type ; /**< Incoming call type @ref ril_calltype_e */
150
+ char number [PHONE_NUMBER_MAX_LEN ]; /**< Phone number as null terminated string */
162
151
};
163
152
164
153
/**
@@ -175,19 +164,15 @@ typedef void (*urc_handler_f)(const char *strURC, void *reserved);
175
164
* @param arg User argument passed via @ref ril_send_atcommand
176
165
* @return RIL response return code @ref ril_resp_rc
177
166
*/
178
- typedef s32 (* atrsp_callback_f )(char * line , u32 len , void * arg );
167
+ typedef int (* atrsp_callback_f )(char * line , uint32_t len , void * arg );
179
168
180
169
/**
181
170
* RIL receive core data callback function
182
171
* @param ptrData Incoming data from RIL core
183
172
* @param dataLen Length of incoming data
184
173
* @param reserved Reserved (unused)
185
174
*/
186
- typedef void (* ril_recvcb_f )(u8 * ptrData , u32 dataLen , void * reserved );
187
-
188
- #ifdef __cplusplus
189
- extern "C" {
190
- #endif
175
+ typedef void (* ril_recvcb_f )(uint8_t * ptrData , uint32_t dataLen , void * reserved );
191
176
192
177
/**
193
178
* Callback variable for user RIL processing function. This variable can be assigned when processing function
@@ -204,7 +189,11 @@ extern ril_recvcb_f cb_rcvCoreData;
204
189
* @param cb [in] processing callback function @ref atrsp_callback_f
205
190
* @param arg [in] User argument passed to callback function
206
191
* @param timeout [in] Timeout for command execution
207
- * @param wait [in] Wait for RIL to be available (TRUE) or not (FALSE). If wait is false, function may return with @ref RIL_AT_BUSY
192
+ * @param wait [in] Wait for RIL to be available (TRUE) or not (FALSE).
193
+ * If wait is false, function returns immideatly if RIL is
194
+ * unavailable.
195
+ * If true function will wait for RIL availability until
196
+ * timeout occurs.
208
197
* @return RIL return code @ref ril_rc_e
209
198
*/
210
199
int ril_send_atcommand (const char * cmd , atrsp_callback_f cb , void * arg , unsigned int timeout , int wait );
@@ -235,10 +224,10 @@ int ril_urc_detach(const char *keyword);
235
224
/**
236
225
* Get exclusive access to Radio interface layer. This lock is only an advisory lock for RIL.
237
226
* @note ril_lock() and ril_unlock() should be called from same task
238
- * @param wait [in] 1 to wait for RIL to be available, 0 otherwise
227
+ * @param timeout [in] Timeout value in milliseconds to wait for lock
239
228
* @return 0 on success, -EWOULDBLOCK on error or when lock is unavailable
240
229
*/
241
- int ril_lock (int wait );
230
+ int ril_lock (int timeout );
242
231
243
232
/**
244
233
* Unlock RIL layer
0 commit comments