6
6
#ifndef INC_RIL_STK_H_
7
7
#define INC_RIL_STK_H_
8
8
9
+ #include <stdint.h>
10
+
9
11
#ifdef __cplusplus
10
12
extern "C" {
11
13
#endif
12
14
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
+
13
31
/**
14
32
* Get SIM toolkit status
15
33
* @return 0 if disabled, 1 if enabled
@@ -23,18 +41,36 @@ int stk_status(void);
23
41
int stk_enable (void );
24
42
25
43
/**
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
29
49
*/
30
- int stk_send_envelope ( const char * env );
50
+ int stk_get_currcommand ( uint8_t * cmd , uint8_t * qual );
31
51
32
52
/**
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
36
72
*/
37
- int stk_send_response ( const char * resp );
73
+ int stk_terminate_session ( void );
38
74
39
75
#ifdef __cplusplus
40
76
}
0 commit comments