Skip to content

Commit f95922c

Browse files
committed
include:ril: update STK API
Signed-off-by: Ajay Bhargav <[email protected]>
1 parent 7168a13 commit f95922c

File tree

1 file changed

+44
-8
lines changed

1 file changed

+44
-8
lines changed

include/ril/ril_stk.h

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,28 @@
66
#ifndef INC_RIL_STK_H_
77
#define INC_RIL_STK_H_
88

9+
#include <stdint.h>
10+
911
#ifdef __cplusplus
1012
extern "C" {
1113
#endif
1214

15+
/**
16+
* @brief STK Command type
17+
*
18+
*/
19+
enum stk_cmd_e {
20+
STK_CMD_INVALID = 0, /**< Invalid command */
21+
STK_CMD_REFRESH = 0x01, /**< Refresh command */
22+
STK_CMD_CALL_SETUP = 0x10, /**< Call setup */
23+
STK_CMD_SEND_USSD = 0x12, /**< Send USSD */
24+
STK_CMD_SEND_SMS = 0x13, /**< Send SMS */
25+
STK_CMD_DISPLAY_TEXT = 0x21,/**< Display test */
26+
STK_CMD_GET_INPUT = 0x23, /**< Get user input */
27+
STK_CMD_SELECT_ITEM = 0x24, /**< Select menu item */
28+
STK_CMD_SETUP_MENU = 0x25, /**< Setup menu */
29+
};
30+
1331
/**
1432
* Get SIM toolkit status
1533
* @return 0 if disabled, 1 if enabled
@@ -23,18 +41,36 @@ int stk_status(void);
2341
int stk_enable(void);
2442

2543
/**
26-
* Send envelope command (AT+STKENV)
27-
* @param env Envelope data as null terminated string
28-
* @return RIL return code @ref ril_rc_e
44+
* @brief Get current proactive command and qualifier ID
45+
*
46+
* @param cmd current TLK command id (@ref stk_cmd_e) (hex)
47+
* @param qual Qualifier value (hex) (optional)
48+
* @return RIL return code @ref ril_rc_e
2949
*/
30-
int stk_send_envelope(const char *env);
50+
int stk_get_currcommand(uint8_t *cmd, uint8_t *qual);
3151

3252
/**
33-
* Send STK response (AT+STKR)
34-
* @param resp Response data as null terminated string
35-
* @return RIL return code @ref ril_rc_e
53+
* Send envelope command (AT+STKENV) to open menu items
54+
*
55+
* @param menu_id Menu ID to open (hex)
56+
* @return RIL return code @ref ril_rc_e
57+
*/
58+
int stk_open_menu(uint8_t menu_id);
59+
60+
/**
61+
* Select menu item (AT+STKR)
62+
*
63+
* @param item_id Item id from menu (hex)
64+
* @return RIL return code @ref ril_rc_e
65+
*/
66+
int stk_select_item(uint8_t item_id);
67+
68+
/**
69+
* @brief Terminate current proactive session
70+
*
71+
* @return RIL return code @ref ril_rc_e
3672
*/
37-
int stk_send_response(const char *resp);
73+
int stk_terminate_session(void);
3874

3975
#ifdef __cplusplus
4076
}

0 commit comments

Comments
 (0)