Radio Interface Layer - RIL¶
Header File¶
Functions¶
-
int
ril_send_atcommand(const char *cmd, atrsp_callback_f cb, void *arg, unsigned int timeout, int wait)¶ Execute and AT command. This function implements sending AT command with the result being returned synchronously. The response of the AT command will be reported to the callback function
- Return
RIL return code ril_rc_e
- Parameters
cmd: [in] AT command stringcb: [in] processing callback function atrsp_callback_farg: [in] User argument passed to callback functiontimeout: [in] Timeout for command executionwait: [in] Wait for RIL to be available (TRUE) or not (FALSE). If wait is false, function returns immideatly if RIL is unavailable. If true function will wait for RIL availability until timeout occurs.
-
int
ril_write_data(const void *data, int len)¶ Send data to RIL core
- Return
On success, this function returns actual length of data written, negative code on error
- Parameters
data: [in] Pointer to data to be sentlen: [in] Length of data
-
int
ril_urc_attach(const char *keyword, urc_handler_f callback)¶ Attach URC to RIL core
- Return
0 on success, negative value on error
- Parameters
keyword: [in] URC Keywordcallback: [in] URC handler function
-
int
ril_urc_detach(const char *keyword)¶ Detach URC from RIL core
- Return
0 on success, negative value on error
- Parameters
keyword: [in] URC keyword
-
int
ril_lock(int timeout)¶ Get exclusive access to Radio interface layer. This lock is only an advisory lock for RIL.
- Note
ril_lock() and ril_unlock() should be called from same task
- Return
0 on success, -EWOULDBLOCK on error or when lock is unavailable
- Parameters
timeout: [in] Timeout value in milliseconds to wait for lock
-
void
ril_unlock(void)¶ Unlock RIL layer
- Note
ril_lock() and ril_unlock() should be called from same task
Structures¶
-
struct
ril_callinfo_t¶ Incoming call phone info
Public Members
-
int
type¶ Incoming call type ril_calltype_e
-
char
number[PHONE_NUMBER_MAX_LEN]¶ Phone number as null terminated string
-
int
Macros¶
-
RIL_MAX_URC_PREFIX_LEN¶ ril.hMaximum allowed URC keyword length
-
PHONE_NUMBER_MAX_LEN¶ Maximum phone number length
Type Definitions¶
-
typedef void (*
urc_handler_f)(const char *strURC, void *reserved)¶ URC handler function type
- Parameters
strURC: Incoming URC linereserved: reserved (unused)
-
typedef int (*
atrsp_callback_f)(char *line, uint32_t len, void *arg)¶ AT command response processing function
- Return
RIL response return code ril_resp_rc
- Parameters
line: Incoming response linelen: Length of response stringarg: User argument passed via ril_send_atcommand
-
typedef void (*
ril_recvcb_f)(uint8_t *ptrData, uint32_t dataLen, void *reserved)¶ RIL receive core data callback function
- Parameters
ptrData: Incoming data from RIL coredataLen: Length of incoming datareserved: Reserved (unused)
Enumerations¶
-
enum
sysinitstate_e¶ System Initialization status
Values:
-
enumerator
SYS_STATE_START= 0¶ System started
-
enumerator
SYS_STATE_ATOK= 1¶ System ready for AT commands
-
enumerator
SYS_STATE_PHBOK= 2¶ Device is ready to make/receive calls
-
enumerator
SYS_STATE_SMSOK= 3¶ SIM card is ready for SMS
-
enumerator
-
enum
simstate_e¶ Definition for SIM Card State
Values:
-
enumerator
SIM_STAT_NOT_INSERTED= 0¶ SIM card not inserted
-
enumerator
SIM_STAT_READY¶ SIM card ready, no further action required
-
enumerator
SIM_STAT_PIN_REQ¶ ME waiting for SIM PIN
-
enumerator
SIM_STAT_PUK_REQ¶ ME waiting for SIM PUK
-
enumerator
SIM_STAT_PH_PIN_REQ¶ ME waiting for Phone to SIM card (anti-theft)
-
enumerator
SIM_STAT_PH_PUK_REQ¶ ME waiting for SIM PUK (anti-theft)
-
enumerator
SIM_STAT_PIN2_REQ¶ SIM PIN2 request (2, e.g. it is possible to edit the FDN book only if preceding command was acknowledged with +CME ERROR:17)
-
enumerator
SIM_STAT_PUK2_REQ¶ SIM PUK2 request (Possible only if preceding command was acknowledged with error +CME ERROR: 18)
-
enumerator
SIM_STAT_BUSY¶ SIM card busy
-
enumerator
SIM_STAT_NOT_READY¶ SIM card not ready
-
enumerator
SIM_STAT_UNSPECIFIED¶ Unknown error
-
enumerator
-
enum
networkstate_e¶ Network Registration status
Values:
-
enumerator
NW_STAT_NOT_REGISTERED= 0¶ Not register and not searching
-
enumerator
NW_STAT_REGISTERED_HOME¶ Registered and in home network
-
enumerator
NW_STAT_SEARCHING¶ Not registered and Searching network
-
enumerator
NW_STAT_REG_DENIED¶ Registration is denied
-
enumerator
NW_STAT_UNKNOWN¶ Unknown registration
-
enumerator
NW_STAT_REGISTERED_ROAMING¶ Registered and in Roaming
-
enumerator
NW_STAT_SMSONLY_HOME¶ 4G LTE Only: Registered for SMS only in home network
-
enumerator
NW_STAT_SMSONLY_ROAMING¶ 4G LTE Only: Registered for SMS only in Roaming network
-
enumerator
-
enum
cfunstate_e¶ Phone functionality state
Values:
-
enumerator
CFUN_STATE_0= 0¶ Minimal functionality
-
enumerator
CFUN_STATE_1= 1¶ Full functionality
-
enumerator
CFUN_STATE_4= 4¶ Disable phone from both transmit ting and receiv ing RF signals
-
enumerator
-
enum
callstatus_e¶ Call status
Values:
-
enumerator
CALL_STATE_ERROR= -1¶ Error
-
enumerator
CALL_STATE_OK= 0¶ Status OK
-
enumerator
CALL_STATE_BUSY¶ Response “BUSY”
-
enumerator
CALL_STATE_NO_ANSWER¶ Response “NO_ANSWER”
-
enumerator
CALL_STATE_NO_CARRIER¶ Response “NO_CARRIER”
-
enumerator
CALL_STATE_NO_DIALTONE¶ Response “NO_DIALTONE”
-
enumerator
CALL_STATE_END¶ CALL_STATE_END
-
enumerator
-
enum
vbattind_e¶ Voltage Indication Type
Values:
-
enumerator
VBATT_UNDER_WRN= 0¶ Warning: Under voltage
-
enumerator
VBATT_UNDER_PDN¶ Warning: Under voltage power-down
-
enumerator
VBATT_OVER_WRN¶ Warning: Over voltage
-
enumerator
VBATT_OVER_PDN¶ Warning: Over voltage power-down
-
enumerator
-
enum
sysurc_e¶ URC Codes
Values:
-
enumerator
URC_SYS_BEGIN= 0¶
-
enumerator
URC_SYS_INIT_STATE_IND¶ Indication for module initialization state during boot stage, parameter value as sysinitstate_e
-
enumerator
URC_SIM_CARD_STATE_IND¶ Indication for SIM card state (state change), parameter value as simstate_e
-
enumerator
URC_GSM_NW_STATE_IND¶ Indication for GSM network state (state change), parameter value as networkstate_e
-
enumerator
URC_GPRS_NW_STATE_IND¶ Indication for GPRS network state (state change), parameter value as networkstate_e
-
enumerator
URC_EGPRS_NW_STATE_IND= 4¶ Indication for EPS Network registration status, parameter value as networkstate_e
-
enumerator
URC_CFUN_STATE_IND¶ Indication for CFUN state, with parameters as one of cfunstate_e
-
enumerator
URC_COMING_CALL_IND¶ Indication for coming call with parameter as ril_callinfo_t
-
enumerator
URC_CALL_STATE_IND¶ Indication for call state (state change), parameter value as callstatus_e
-
enumerator
URC_NEW_SMS_IND¶ Indication for new short message, parameter value as index of incoming SMS
-
enumerator
URC_MODULE_VOLTAGE_IND¶ Indication for abnormal voltage of module supply power, parameter value as vbattind_e
-
enumerator
URC_ALARM_RING_IND¶ Indication for clock alarm.
-
enumerator
URC_STKPCI_RSP_IND¶ Indication for un-handled STKPCI responses, Only when QSTK is enabled, Parameter value is incoming +STKPCI response as null terminated string
-
enumerator
URC_RRC_STATUS_IND¶ 4GLTE & NBIoT RRC Status update
-
enumerator
URC_SYS_END= 100¶
-
enumerator
URC_END¶ Unhandled URC response
-
enumerator
-
enum
ril_resp_rc¶ Return code for AT command response process callback function If callback function returns RIL_ATRSP_CONTINUE, ril_send_atcommand will continue to block and process incoming response until callback function returns a success or fail response.
Values:
-
enumerator
RIL_ATRSP_FAILED= -1¶ AT command response processing failed
-
enumerator
RIL_ATRSP_SUCCESS= 0¶ AT command response processing success
-
enumerator
RIL_ATRSP_CONTINUE= 1¶ Continue processing incoming response of AT command
-
enumerator
-
enum
ril_rc_e¶ RIL Return code
Values:
-
enumerator
RIL_AT_SUCCESS= 0¶ AT Command executed successfully
-
enumerator
RIL_AT_FAILED= -1¶ AT Command execution failed
-
enumerator
RIL_AT_TIMEOUT= -2¶ AT command sent but response timeout
-
enumerator
RIL_AT_BUSY= -3¶ RIL is busy
-
enumerator
RIL_AT_INVALID_PARAM= -4¶ Invalid parameter
-
enumerator
RIL_AT_UNINITIALIZED= -5¶ RIL is not initialized
-
enumerator
