Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages | Examples

SIM Toolkit functions


Detailed Description

The API provides several wrappers for STK functions as described in Ref. 11.14. Further there are several higher functions for developer convenience.

You can create your own wrapper with the help of stk_cmd().

Data Structures

Defines

Typedefs

Functions


Define Documentation

#define ALPHA_LEN
 

Max. ALPHA (EF_ADN) length.

#define APP_NO
 

User selected NO

#define APP_YES
 

User selected YES

#define BEARER_CSD
 

Indicates CSD bearer.

#define BEARER_GPRS
 

Indicates GPRS bearer.

#define BER_TLV_ME_TO_SIM_CALL_CONTROL
 

ENVELOPE CALL CONTROLL Tag Ref. 11.14

#define BER_TLV_ME_TO_SIM_CB_DOWNLOAD
 

ENVELOPE CB DOWNLOAD Tag Ref. 11.14

#define BER_TLV_ME_TO_SIM_EVENT_DOWNLOAD
 

ENVELOPE EVENT DOWNLOAD Tag Ref. 11.14

#define BER_TLV_ME_TO_SIM_MENU_SELECTION
 

ENVELOPE SIM MENU SELECTION Tag Ref. 11.14

#define BER_TLV_ME_TO_SIM_MO_SMS_CONTROL
 

ENVELOPE MO SMS CONTROL Tag Ref. 11.14

#define BER_TLV_ME_TO_SIM_RESERVED_TIA_EIA_136
 

RFU Ref. 11.14

#define BER_TLV_ME_TO_SIM_SMS_PP_DOWNLOAD
 

ENVELOPE SMS-PP DOWNLOAD Tag Ref. 11.14

#define BER_TLV_ME_TO_SIM_TIMER_EXPIRATION
 

ENVELOPE TIMER EXPIRATION Tag Ref. 11.14

#define BER_TLV_SIM_TO_ME_PROACTIVE_CMD
 

Ref. 11.14

#define CR_FLAG
 

Comprehension required flag. Ref. 11.14

#define DEV_ID_DISPLAY
 

Ref. 11.14

#define DEV_ID_EARPIECE
 

Ref. 11.14

#define DEV_ID_KEYPAD
 

Ref. 11.14

#define DEV_ID_ME
 

Ref. 11.14

#define DEV_ID_NETWORK
 

Ref. 11.14

#define DEV_ID_SIM
 

Ref. 11.14

#define DURATION_10_SEC
 

play_tone() constant, Ref. 11.11.

#define DURATION_MIN
 

play_tone() constant, Ref. 11.11.

#define DURATION_SEC
 

play_tone() constant, Ref. 11.11.

#define ENULL
 

"End NULL" means User End.

#define IPPROTO_TCP
 

Indicates TCP IP protocol.

#define IPPROTO_UDP
 

Indicates UDP IP protocol.

#define Q_DISPLAY_ICON_NOT_SELF_EXP
 

Ref. 11.14

#define Q_DISPLAY_ICON_SELF_EXP
 

Ref. 11.14

#define Q_DISPLAY_TEXT_DELAY_CLEAR
 

Ref. 11.14

#define Q_DISPLAY_TEXT_HIGH_PRIORITY
 

Ref. 11.14

#define Q_DISPLAY_TEXT_NORMAL_PRIORITY
 

Ref. 11.14

#define Q_DISPLAY_TEXT_USER_CLEAR
 

Ref. 11.14

#define Q_GET_INKEY_CHAR
 

Ref. 11.14

#define Q_GET_INKEY_DIGIT
 

Ref. 11.14

#define Q_GET_INKEY_HELP
 

Ref. 11.14

#define Q_GET_INKEY_UCS2
 

Ref. 11.14

#define Q_GET_INKEY_YESNO
 

Ref. 11.14

#define Q_GET_INPUT_ALPHABET
 

Ref. 11.14

#define Q_GET_INPUT_DIGITS
 

Ref. 11.14

#define Q_GET_INPUT_HELP
 

Ref. 11.14

#define Q_GET_INPUT_NO_ECHO
 

Ref. 11.14

#define Q_GET_INPUT_SMS_PACKED
 

Ref. 11.14

#define Q_GET_INPUT_UCS2
 

Ref. 11.14

#define Q_LAUNCH_BROWSER_NEW
 

Ref. 11.14

#define Q_LAUNCH_BROWSER_REOPEN
 

Ref. 11.14

#define Q_LAUNCH_BROWSER_REUSE
 

Ref. 11.14

#define Q_OPEN_CHANNEL_AUTOMATIC_RECONNECTION
 

Ref. 11.14

#define Q_OPEN_CHANNEL_IMMEDIATE
 

Ref. 11.14

#define Q_OPEN_CHANNEL_ONDEMAND
 

Ref. 11.14

#define Q_REFRESH_SIM_FILE_CHANGE
 

Ref. 11.14

#define Q_REFRESH_SIM_INIT
 

Ref. 11.14

#define Q_REFRESH_SIM_INIT_FILE_CHANGE
 

Ref. 11.14

#define Q_REFRESH_SIM_INIT_FULL_FILE
 

Ref. 11.14

#define Q_REFRESH_SIM_RESET
 

Ref. 11.14

#define Q_SELECT_ITEM_CHOICE
 

Ref. 11.14

#define Q_SELECT_ITEM_HELP
 

Ref. 11.14

#define Q_SELECT_ITEM_NAVIGATION
 

Ref. 11.14

#define Q_SELECT_ITEM_NO_PRESENTATION
 

Ref. 11.14

#define Q_SEND_DATA_BUFFERED
 

Ref. 11.14

#define Q_SEND_DATA_IMMEDIATELY
 

Ref. 11.14

#define Q_YESNO_DELETE_QMARK
 

Concat string with localized "Delete" and question mark. I.e. result is "Delete (string)?".

#define Q_YESNO_QMARK
 

Ref. 11.14

#define STK_CMD_CLOSE_CHANNEL
 

Proactive SIM CLOSE CHANNEL command. Ref. 11.14

#define STK_CMD_DISPLAY_TEXT
 

Proactive SIM DISPLAY TEXT command. Ref. 11.14

#define STK_CMD_END_OF_PROACTIVE_SESSION
 

RDU, Proactive SIM command. Ref. 11.14

#define STK_CMD_GET_CHANNEL_STATUS
 

Proactive SIM GET CHANNEL STATUS command. Ref. 11.14

#define STK_CMD_GET_INKEY
 

Proactive SIM GET INKEY command. Ref. 11.14

#define STK_CMD_GET_INPUT
 

Proactive SIM GET INPUT command. Ref. 11.14

#define STK_CMD_GET_READER_STATUS
 

Proactive SIM GET READER STATUS command. Ref. 11.14

#define STK_CMD_LANGUAGE_NOTIFICATION
 

Proactive SIM LANGUAGE NOTIFICATION command. Ref. 11.14

#define STK_CMD_LAUNCH_BROWSER
 

Proactive SIM LAUNCH BROWSER command. Ref. 11.14

#define STK_CMD_MORE_TIME
 

Proactive SIM MORE TIME command. Ref. 11.14

#define STK_CMD_NULL
 

RFU, do not use. Ref. 11.14

#define STK_CMD_OPEN_CHANNEL
 

Proactive SIM OPEN CHANNEL command. Ref. 11.14

#define STK_CMD_PERFORM_CARD_APDU
 

Proactive SIM PERFORM CARD APDU command. Ref. 11.14

#define STK_CMD_PLAY_TONE
 

Proactive SIM PLAY TONE command. Ref. 11.14

#define STK_CMD_POLL_INTERVAL
 

Proactive SIM POLL INTERVAL command. Ref. 11.14

#define STK_CMD_POLLING_OFF
 

Proactive SIM POLLING OFF command. Ref. 11.14

#define STK_CMD_POWER_OFF_CARD
 

Proactive SIM POWER OFF CARD command. Ref. 11.14

#define STK_CMD_POWER_ON_CARD
 

Proactive SIM POWER ON CARD command. Ref. 11.14

#define STK_CMD_PROVIDE_LOCAL_INFO
 

Proactive SIM PROVIDE LOCAL INFO command. Ref. 11.14

#define STK_CMD_RECEIVE_DATA
 

Proactive SIM RECEIVE DATA command. Ref. 11.14

#define STK_CMD_REFRESH
 

Proactive SIM REFRESH command. Ref. 11.14

#define STK_CMD_RESERVER_TIA_EIA_136
 

RFU, Proactive SIM command. Ref. 11.14

#define STK_CMD_RUN_AT_COMMAND
 

Proactive SIM RUN AT COMMAND command. Ref. 11.14

#define STK_CMD_SELECT_ITEM
 

Proactive SIM SELECT ITEM command. Ref. 11.14

#define STK_CMD_SEND_DATA
 

Proactive SIM SEND DATA command. Ref. 11.14

#define STK_CMD_SEND_DTMF
 

Proactive SIM SEND DTMF command. Ref. 11.14

#define STK_CMD_SEND_SMS
 

Proactive SIM SEND SMS command. Ref. 11.14

#define STK_CMD_SEND_SS
 

Proactive SIM SEND SS command. Ref. 11.14

#define STK_CMD_SEND_USSD
 

Proactive SIM SEND USSD command. Ref. 11.14

#define STK_CMD_SET_UP_CALL
 

Proactive SIM SET UP CALL command. Ref. 11.14

#define STK_CMD_SET_UP_EVENT_LIST
 

Proactive SIM SET UP EVENT LIST command. Ref. 11.14

#define STK_CMD_SET_UP_IDLE_MODE_TEXT
 

Proactive SIM SET UP IDLE MODE TEXT command. Ref. 11.14

#define STK_CMD_SET_UP_MENU
 

Proactive SIM SET UP MENU command. Ref. 11.14

#define STK_CMD_TIMER_MANAGEMENT
 

Proactive SIM TIMER MANAGEMENT command. Ref. 11.14

#define T_ADDRESS
 

Address tag Ref. 11.14

#define T_ALPHA_ID
 

Alpha identifier tag Ref. 11.14

#define T_AT_CMD
 

AT command tag Ref. 11.14

#define T_AT_RESPONSE
 

AT response tag Ref. 11.14

#define T_BC_REPEAT_INDICATOR
 

BC repeat indicator tag Ref. 11.14

#define T_BCCH_CHANNEL_LIST
 

BCCH channel list tag Ref. 11.14

#define T_BEARER
 

Bearer tag Ref. 11.14

#define T_BEARER_DESCRIPTION
 

Bearer description tag Ref. 11.14

#define T_BROWSER_ID
 

Browser ID tag Ref. 11.14

#define T_BROWSER_TERMINATION_CAUSE
 

Browser termination cause tag Ref. 11.14

#define T_BUFFER_SIZE
 

Buffer size tag Ref. 11.14

#define T_C_APDU
 

C-APDU tag Ref. 11.14

#define T_CALL_CONTROL_REQUESTED_ACTION
 

Call control requested action tag Ref. 11.14

#define T_CAPABILITY_CONF
 

Capability configuration tag Ref. 11.14

#define T_CARD_ATR
 

Card ATR tag Ref. 11.14

#define T_CARD_READER_ID
 

Card reader ID tag Ref. 11.14

#define T_CARD_READER_STATUS
 

Card reader status tag Ref. 11.14

#define T_CAUSE
 

Cause tag Ref. 11.14

#define T_CB_PAGE
 

Cell broadcast page tag Ref. 11.14

#define T_CHANNEL_DATA
 

Channel data tag Ref. 11.14

#define T_CHANNEL_DATA_LEN
 

Channel data length tag Ref. 11.14

#define T_CHANNEL_STATUS
 

Channel status tag Ref. 11.14

#define T_CMD_DETAILS
 

Command Details Tag Ref. 11.14

#define T_DATE
 

Date tag Ref. 11.14

#define T_DEFAULT_TEXT
 

Default text tag Ref. 11.14

#define T_DEVICE_ID
 

Device Identities Tag Ref. 11.14

#define T_DTMF_STRING
 

DTMF string tag Ref. 11.14

#define T_DURATION
 

Duration tag Ref. 11.14

#define T_EVENT_LIST
 

Event list tag Ref. 11.14

#define T_FILE_LIST
 

File list tag Ref. 11.14

#define T_HELP_REQUEST
 

Help request tag Ref. 11.14

#define T_ICON_ID
 

Icon ID tag Ref. 11.14

#define T_IMEI
 

IMEI tag Ref. 11.14

#define T_IMMEDIATE_RESPONSE
 

Immediate response tag Ref. 11.14

#define T_ITEM
 

Item tag Ref. 11.14

#define T_ITEM_ICON_ID_LIST
 

Item icon ID list tag Ref. 11.14

#define T_ITEM_ID
 

Item ID tag Ref. 11.14

#define T_ITEMS_NEXT_ACTION_INDICATOR
 

Items next axtion indicator tag Ref. 11.14

#define T_LANGUAGE
 

Language tag Ref. 11.14

#define T_LOCATION_INFO
 

Location information tag Ref. 11.14

#define T_LOCATION_STATUS
 

Location status tag Ref. 11.14

#define T_NETWORK_ACCESS_NAME
 

Network access name tag Ref. 11.14

#define T_NMR
 

Network Measurement Result tag Ref. 11.14

#define T_NOT_USED_3B
 

RFU Ref. 11.14

#define T_NOT_USED_3D
 

RFU Ref. 11.14

#define T_OTHER_ADDRESS
 

Other address tag Ref. 11.14

#define T_PROVISIONING_REFERENCE_FILE
 

Provisioning reference file tag Ref. 11.14

#define T_R_APDU
 

R-APDU tag Ref. 11.14

#define T_RESERVED_2F
 

RFU Ref. 11.14

#define T_RESERVED_ETIA_136_60
 

RFU Ref. 11.14

#define T_RESERVED_ETIA_136_61
 

RFU Ref. 11.14

#define T_RESPONSE_LEN
 

Response length tag Ref. 11.14

#define T_RESULT
 

Result tag Ref. 11.14

#define T_SIM_ME_INTERFACE_TRANSPORT_LEVEL
 

SIM-ME interface transport level tag Ref. 11.14

#define T_SMS_TPDU
 

SMS TPDU tag Ref. 11.14

#define T_SS_STRING
 

Suplementary services string tag Ref. 11.14

#define T_SUBADDRESS
 

Subaddress tag Ref. 11.14

#define T_TEXT_STRING
 

Text string tag Ref. 11.14

#define T_TIMER_ID
 

Timer ID tag Ref. 11.14

#define T_TIMER_VALUE
 

Timer value tag Ref. 11.14

#define T_TIMING_ADVANCE
 

Timing advance tag Ref. 11.14

#define T_TONE
 

Tone tag Ref. 11.14

#define T_TRANSACTION_ID
 

Transaction identifier tag Ref. 11.14

#define T_URL
 

URL tag Ref. 11.14

#define T_USSD_STRING
 

USSD string tag Ref. 11.14

#define TONE_BEEP
 

play_tone() constant, Ref. 11.11.

#define TONE_BUSY
 

play_tone() constant, Ref. 11.11.

#define TONE_CONGESTION
 

play_tone() constant, Ref. 11.11.

#define TONE_DIAL
 

play_tone() constant, Ref. 11.11.

#define TONE_ERROR
 

play_tone() constant, Ref. 11.11.

#define TONE_NEGATIVE
 

play_tone() constant, Ref. 11.11.

#define TONE_POSITIVE
 

play_tone() constant, Ref. 11.11.

#define TONE_RADIO_ACK
 

play_tone() constant, Ref. 11.11.

#define TONE_RADIO_NO
 

play_tone() constant, Ref. 11.11.

#define TONE_RINGING
 

play_tone() constant, Ref. 11.11.

#define TONE_WAITING
 

play_tone() constant, Ref. 11.11.


Typedef Documentation

typedef struct _Sockaddr Sockaddr
 

Network socket structure used for open_channel_raw().


Function Documentation

void change_imsi void   ) 
 

Warning:
SIM Toolkit function, usable only in stk_thread(). Change EF_IMSI procedure according the Ref. 11.11.
Examples:
fake_sim.c.

void close_channel u8  channel  ) 
 

Wrapper around the STK CLOSE CHANNEL command.

Warning:
SIM Toolkit function, usable only in stk_thread().
Parameters:
channel 
See also:
open_channel_raw(), get_channel_status()
Examples:
net.c.

u8 display_more u32  file  ) 
 

AKA "more" command - show content of file as text.

Warning:
SIM Toolkit function, usable only in stk_thread().
Parameters:
file Inode pointer on file.
Returns:
APP_END, APP_BACK
Examples:
mc.c, and reader.c.

u8 display_text const u8 body,
const u8 head
 

Compose and display text. It can consists of two parts - head and body. If the total length exceeds display_text_len then head is not displayed.

Warning:
SIM Toolkit function, usable only in stk_thread().
Parameters:
body body, ALPHA coding or STRING_SLV coding, from RAM, EEPROM, PROGMEM
head head, ALPHA coding or STRING_SLV coding, from RAM, EEPROM, PROGMEM
Returns:
APP_BACK if user back, APP_END if user end, APP_OK if user ok
Examples:
certs.c, fake_sim.c, hello_world_ucs2.c, mc.c, net.c, sysinfo.c, test_idle.c, and test_prot_mem.c.

u8* display_text_raw const u8 text,
u8  q
 

Wrapper around STK DISPLAY TEXT command.

Warning:
SIM Toolkit function, usable only in stk_thread().
Parameters:
text text, ALPHA coding or STRING_SLV coding, from RAM, EEPROM, PROGMEM.
q Q_DISPLAY_TEXT_NORMAL_PRIORITY or Q_DISPLAY_TEXT_HIGH_PRIORITY, Q_DISPLAY_TEXT_DELAY_CLEAR or Q_DISPLAY_TEXT_USER_CLEAR.
Returns:
TERMINAL RESPONSE in buf_A().
Examples:
adc.c, braled.c, braping.c, firststk.c, hello_world.c, net.c, pos.c, shmem.c, temperature.c, timer.c, topmenu.c, and tsmsacl.c.

u8* get_channel_status void   ) 
 

Wrapper around the STK GET CHANNEL STATUS command.

Warning:
SIM Toolkit function, usable only in stk_thread().
Returns:
TERMINAL RESPONSE in buf_A().
See also:
open_channel_raw(), close_status()

u8* get_inkey const u8 text,
u8  q
 

Wrapper around STK GET INKEY command.

Warning:
SIM Toolkit function, usable only in stk_thread().
Parameters:
text Text, ALPHA coding or STRING_SLV coding, from RAM, EEPROM, PROGMEM.
q Q_GET_INKEY_DIGIT or Q_GET_INKEY_CHAR or Q_GET_INKEY_YESNO, Q_GET_INKEY_UCS2, Q_GET_INKEY_HELP
Returns:
NULL if user back, ENULL if user END, pointer to buf_A() on tag T_TEXT_STRING.

u8* get_input const u8 text,
u8  resp_len_min,
u8  resp_len_max,
const u8 default_text,
u8  q
 

Wrapper around STK GET INPUT command.

Warning:
SIM Toolkit function, usable only in stk_thread().
Parameters:
text Text, ALPHA coding or STRING_SLV coding, from RAM, EEPROM, PROGMEM.
resp_len_min Minimum response length.
resp_len_max Maximum repsonse length.
default_text Default text, ALPHA coding or STRING_SLV coding, from RAM, EEPROM, PROGMEM.
q Q_GET_INPUT_DIGITS or Q_GET_INPUT_ALPHABET, or'ed Q_GET_INPUT_UCS2, Q_GET_INPUT_NO_ECHO, Q_GET_INPUT_SMS_PACKED, Q_GET_INPUT_HELP
Returns:
NULL if user back, ENULL if user END, pointer to buf_A() on tag T_TEXT_STRING.
Examples:
braping.c, calc.c, certs.c, fake_sim.c, mc.c, stkcmd.c, sysinfo.c, test_img.c, and test_prot_mem.c.

u8 get_tag u8 s,
u8  tag
 

Find a TAG in BER-TLV array. First byte is the overall length.

Parameters:
s BER-TLV coded element array, RAM only
tag desired TAG
Returns:
offset in s TAG if found, 0 if tag not found otherwise.
Examples:
braping.c, cells.c, net.c, pos.c, and test_refresh.c.

void insert_menu const u8 text  ) 
 

Insert top-level menu item. Can be used in ACTION_INSERT_MENU handling code only.

Note:
Application can insert max. 4 menus. Items are numbered 0, 1, 2, 3.
Parameters:
text Menu item text, ALPHA coding or unpacked STRING_SLV coding, can be from RAM, EEPROM, PROGMEM.
See also:
ACTION_INSERT_MENU, set_menu_alpha().
Examples:
adc.c, braled.c, braping.c, browser.c, calc.c, callback.c, certs.c, fake_sim.c, hello_world.c, hello_world_ucs2.c, mc.c, net.c, pos.c, reader.c, shmem.c, stkcmd.c, sysinfo.c, temperature.c, test_idle.c, test_img.c, test_prot_mem.c, test_refresh.c, timer.c, topmenu.c, and tsmsacl.c.

u8* launch_browser const u8 url,
u8  q
 

Wrapper around the STK LAUNCH BROWSER command.

Warning:
SIM Toolkit function, usable only in stk_thread().
Parameters:
url URL, can be stored in RAM, EEPROM, PROGMEM.
q Q_LAUNCH_BROWSER_NEW or Q_LAUNCH_BROWSER_REUSE or Q_LAUNCH_BROWSER_REOPEN
Returns:
TERMINAL RESPONSE in buf_A().
Examples:
browser.c.

u8* more_time void   ) 
 

Wrapper around STK MORE TIME command.

Warning:
SIM Toolkit function, usable only in stk_thread().
Returns:
TERMINAL RESPONSE in buf_A().

u8 not_implemented void   ) 
 

Convenience function, display text "Not implemented".

Warning:
SIM Toolkit function, usable only in stk_thread().
Returns:
APP_END, APP_BACK

u8* open_channel_raw Sockaddr dst,
u8  q,
u16  buf_size
 

Wrapper around the STK OPEN CHANNEL command. Application has to register ACTION_EVENT_DATA_AVAILABLE to be notified when data are received.

Low level function returning TERMINAL RESPONSE. To get the channel number use the following:

u8 *res;
u8 j;
u8 ch;

res = open_channel_raw (...);
j = get_tag (res, T_CHANNEL_STATUS);
if (j != 0)
{
  ch = res[j+2] & 0x07;
  if (ch != 0)
  {
  // open OK
  }
}
else
{
// open ERROR
}

Warning:
SIM Toolkit function, usable only in stk_thread().
Parameters:
dst destination (protocol, port, ip address).
q (Q_OPEN_CHANNEL_ONDEMAND or Q_OPEN_CHANNEL_IMMEDIATE)|Q_OPEN_CHANNEL_AUTOMATIC_RECONNECTION
buf_size 
Returns:
TERMINAL RESPONSE in buf_A().
See also:
close_channel(), get_channel_status(), ACTION_EVENT_DATA_AVAILABLE, get_tag(), T_CHANNEL_STATUS
Examples:
net.c.

u8* play_tone const u8 alpha,
u8  tone,
u8  units,
u8  duration
 

Wrapper around STK PLAY TONE command.

Warning:
SIM Toolkit function, usable only in stk_thread().
Parameters:
alpha alpha text, ALPHA coding or unpacked STRING_SLV coding, can be from RAM, EEPROM or PROGMEM
tone TONE_DIAL, TONE_BUSY, TONE_CONGESTION, TONE_RADIO_ACK, TONE_RADIO_NO, TONE_ERROR, TONE_WAITING, TONE_RINGING, TONE_BEEP, TONE_POSITIVE, TONE_NEGATIVE
units DURATION_MIN, DURATION_SEC, DURATION_10_SEC
duration 
Returns:
TERMINAL RESPONSE in buf_A().

u8* poll_interval u8  units,
u8  duration
 

Wrapper around STK POLL INTERVAL command.

Warning:
SIM Toolkit function, usable only in stk_thread().
Parameters:
units DURATION_MIN, DURATION_SEC, DURATION_10_SEC
duration 
Returns:
TERMINAL RESPONSE in buf_A().

u8* provide_date void   ) 
 

Wrapper around STK PROVIDE LOCAL INFO command.

Warning:
SIM Toolkit function, usable only in stk_thread().
Returns:
TERMINAL RESPONSE in buf_A().
See also:
get_tag(), T_DATE
Examples:
pos.c.

u8* provide_imei void   ) 
 

Wrapper around STK PROVIDE LOCAL INFO command.

Warning:
SIM Toolkit function, usable only in stk_thread().
Returns:
TERMINAL RESPONSE in buf_A().
See also:
get_tag(), T_IMEI
Examples:
pos.c.

u8* provide_language void   ) 
 

Wrapper around STK PROVIDE LOCAL INFO command.

Warning:
SIM Toolkit function, usable only in stk_thread().
Returns:
TERMINAL RESPONSE in buf_A().
See also:
get_tag(), T_LANGUAGE
Examples:
pos.c.

u8* provide_local_info void   ) 
 

Wrapper around STK PROVIDE LOCAL INFO command.

Warning:
SIM Toolkit function, usable only in stk_thread().
Returns:
TERMINAL RESPONSE in buf_A().
See also:
get_tag(), T_LOCATION_INFO
Examples:
pos.c.

u8* provide_nmr void   ) 
 

Wrapper around STK PROVIDE LOCAL INFO command.

Warning:
SIM Toolkit function, usable only in stk_thread().
Returns:
TERMINAL RESPONSE in buf_A().
See also:
get_tag(), T_NMR, T_BCCH_CHANNEL_LIST
Examples:
pos.c.

u8* provide_ta void   ) 
 

Wrapper around STK PROVIDE LOCAL INFO command.

Warning:
SIM Toolkit function, usable only in stk_thread().
Returns:
TERMINAL RESPONSE in buf_A().
See also:
get_tag(), T_TIMING_ADVANCE
Examples:
pos.c.

u8* receive_data_raw u8  channel,
u8  len
 

Wrapper around the STK RECEIVE DATA command.

Warning:
SIM Toolkit function, usable only in stk_thread().
Parameters:
channel 
len 
Returns:
TERMINAL RESPONSE in buf_A().
See also:
open_channel_raw(), ACTION_EVENT_DATA_AVAILABLE, get_tag(), T_CHANNEL_DATA_LEN, T_CHANNEL_DATA
Examples:
net.c.

u8* refresh u8  what,
u8  nr_files,
u8  len,
u8 filebuf
 

Wrapper around the STK REFRESH command. The purpose REFRESH is to inform ME that something on SIM was changed by the SIM. The what argument says what was changed, ie. what to refresh.

Warning:
SIM Toolkit function, usable only in stk_thread().
Parameters:
what Q_REFRESH_SIM_INIT_FULL_FILE, Q_REFRESH_SIM_FILE_CHANGE, Q_REFRESH_SIM_INIT_FILE_CHANGE, Q_REFRESH_SIM_INIT, Q_REFRESH_SIM_RESET.
nr_files number of paths, only if what is Q_REFRESH_SIM_FILE_CHANGE or Q_REFRESH_SIM_INIT_FILE_CHANGE
len length of filebuf in bytes, only if what is Q_REFRESH_SIM_FILE_CHANGE or Q_REFRESH_SIM_INIT_FILE_CHANGE
filebuf pointer on paths, only if what is Q_REFRESH_SIM_FILE_CHANGE or Q_REFRESH_SIM_INIT_FILE_CHANGE, RAM only
Returns:
TERMINAL RESPONSE in buf_A().
Examples:
test_refresh.c.

void refresh_sms void   ) 
 

STK REFRESH EF_SMS (=3F00:7F10:6F3C).

Warning:
SIM Toolkit function, usable only in stk_thread().

u8* select_item u8  nr_items,
const u8 **  items,
const u8 alpha,
const u8 text_r,
u8  def_item,
u8  q
 

Wrapper around STK SELECT ITEM command.

Warning:
SIM Toolkit function, usable only in stk_thread().
Parameters:
nr_items number of items
items pointer on array of pointers on strings, ALPHA coding or unpacked STRING_SLV coding
alpha alpha text, ALPHA coding or unpacked STRING_SLV coding, can be stored in RAM, EEPROM or PROGMEM
text_r extra first item, ALPHA coding or unpacked STRING_SLV coding, can be in RAM, EEPROM, PROGMEM
def_item default item, 1...nr_items
q Q_SELECT_ITEM_NO_PRESENTATION, Q_SELECT_ITEM_CHOICE, Q_SELECT_ITEM_NAVIGATION, or'ed Q_SELECT_ITEM_HELP
Returns:
TERMINAL RESPONSE in buf_A().
Examples:
test_refresh.c.

u8* send_data_raw u8  channel,
const u8 data,
u8  data_len,
u8  q
 

Wrapper around the STK SEND DATA command.

Warning:
SIM Toolkit function, usable only in stk_thread().
Parameters:
channel 
data can be from RAM, EEPROM, PROGMEM
data_len 
q Q_SEND_DATA_BUFFERED or Q_SEND_DATA_IMMEDIATELY
Returns:
TERMINAL RESPONSE in buf_A().
See also:
open_channel_raw()
Examples:
net.c.

u8* send_sms u8 ud,
u8  len,
u8 msisdn,
u8  da_type,
u8  dcs,
u8  pid,
const u8 alpha,
u8 tpdu
 

Wrapper around the STK SEND SHORT MESSAGE command.

Warning:
SIM Toolkit function, usable only in stk_thread().
#include <config.h>
#include <turbo/turbo.h>

u8 PROGMEM t_sms_ex[]="Example sms";
u8 PROGMEM t_ms[]="+420123456789";

void action_sms(void *data)
{
u8 *sms_data=malloc(100);
u8 *ms=str2msisdn(t_ms, MSISDN_ADN, MEM_R);

memcpy(sms_data, t_sms_ex, sizeof(t_sms_ex)); 
send_sms(sms_data, sizeof(t_sms_ex), ms, MSISDN_ADN, 0xF6, 0, NULL, NULL);

free(sms_data);
free(ms);
}

As of pid the usual values are:

  • 0x00 the simple MS-to-SC short message (i.e. ordinary SMS).
  • 0x7f the SIM Data Download message.

The PID 0x7f is used by the STK applications to send and receive SMS without the user intervention, ME must pass the message to the SIM using ENVELOPE SMS_PP_DOWNLOAD EVENT.

Attention:
The usage of PID 0x7F can be restricted by the mobile operator (although there is no technical nor security reason).
If you want to use PID 0x7f we suggest to use tsms_pid() call instead. The return value of tsms_pid() is configurable by user and can be set to 0x00 in case his operator does not permit 0x7f PID.

dcs typical values are:

  • 0x00 - default alphabet, 7bit coding, class 0.
  • 0xF6 - 8bit data, class 2.

Class 0 means that is upon receiving ME what to do with the incoming message (pass it to SIM or store it in ME memory), Class 2 means SIM specific message, i.e. ME should pass it to SIM.

Ref. Ref. 03.38 for alphabets and details.

If dcs is 7b then the user data has to be already compressed.

Parameters:
ud pointer on the data of SMS (i.e. message itself), always from MEM_R.
len length of data in bytes.
msisdn pointer on MSISDN, MSISDN Handling.
da_type type of MSISDN, MSISDN Handling.
dcs DCS (Data Coding Scheme), ref. Ref. 03.38.
pid PID of SMS, ref. Ref. 03.40.
alpha alpha (optional), ALPHA coding or unpacked STRING_SLV coding, from RAM, EEPROM, PROGMEM.
tpdu returns pointer on resulting TPDU if not NULL.
Returns:
TERMINAL RESPONSE in buf_A().
See also:
get_tag()
Examples:
alarm.c, alarm_flipflop.c, callback.c, certs.c, pos.c, and tsmsacl.c.

void set_menu_alpha const u8 text  ) 
 

Set top-level menu label. Can be used in ACTION_INSERT_MENU handling code only.

Parameters:
text Menu item text, ALPHA coding or unpacked STRING_SLV coding, can be from RAM, EEPROM, PROGMEM.
See also:
ACTION_INSERT_MENU
Examples:
topmenu.c.

u8* set_up_call u8 msisdn,
u8  da_type,
const u8 alpha
 

Wrapper around the STK SET UP CALL command.

Warning:
SIM Toolkit function, usable only in stk_thread().
Parameters:
msisdn MSISDN, can be from RAM, EEPROM, PROGMEM.
da_type MSISDN_ADN or MSISDN_SMS.
alpha alpha, ALPHA coding or unpacked STRING_SLV coding, can be from RAM, EEPROM or PROGMEM.
Returns:
TERMINAL RESPONSE in buf_A().
Examples:
callback.c.

u8* set_up_event_list void   ) 
 

In case EVENT DOWNLOAD actions are registered (and unregistered) ad-hoc you must call set_up_event_list() to pass the actual event list to ME.

The event list is updated always if application registers ACTION_EVENT_? during ACTION_APP_INIT.

The event actions are: ACTION_EVENT_MT_CALL, ACTION_EVENT_CALL_CONNECTED, ACTION_EVENT_CALL_DISCONNECTED, ACTION_EVENT_LOCATION_STATUS, ACTION_EVENT_USER_ACTIVITY, ACTION_EVENT_IDLE_SCREEN, ACTION_EVENT_CARD_READER_STATUS, ACTION_EVENT_LANGUAGE_SELECTION, ACTION_EVENT_BROWSER_TERMINATION, ACTION_EVENT_DATA_AVAILABLE, ACTION_EVENT_CHANNEL_STATUS.

Warning:
SIM Toolkit function, usable only in stk_thread().
Returns:
TERMINAL RESPONSE in buf_A().
See also:
reg_action(), unreg_action()

u8* set_up_menu void   ) 
 

Wrapper around the STK SET UP MENU command.

Warning:
SIM Toolkit function, usable only in stk_thread().
Returns:
TERMINAL RESPONSE in buf_A().
Examples:
mc.c.

u8* stk_cmd u8  cmd,
u8  q,
u8  to_id,
u8  len
 

Compose SIM Toolkit command stored in buf_A() and wave for FETCH.

Warning:
SIM Toolkit function, usable only in stk_thread().
Parameters:
cmd command Ref. 11.14
q command qualifier Ref. 11.14
to_id TO device identities Ref. 11.14
len length of data in buf_A().
Returns:
pointer of buffer (=buf_A()) containing TERMINAL RESPONSE.
Examples:
stkcmd.c.

const u8* terminal_profile void   ) 
 

Returns ME's TERMINAL PROFILE. First byte contains length.

Examples:
pos.c, and sysinfo.c.

u8 timer_start u8  h,
u8  m,
u8  s
 

Wrapper around STK TIMER MANAGEMENT command - start timer.

Warning:
SIM Toolkit function, usable only in stk_thread().
Parameters:
h hours
m minutes
s seconds
Returns:
assigned timer id, 0 if none available.
Examples:
timer.c.

u32 timer_stop u8  t  ) 
 

Wrapper around STK TIMER MANAGEMENT command - stop timer.

Warning:
SIM Toolkit function, usable only in stk_thread().
Parameters:
t timer id
Returns:
tag T_TIMER_VALUE converted to u32.

u32 timer_value u8  t  ) 
 

Wrapper around STK TIMER MANAGEMENT command - current timer value.

Warning:
SIM Toolkit function, usable only in stk_thread().
Parameters:
t timer id
Returns:
object T_TIMER_VALUE converted to u32.

u8 yesno const u8 text,
u8  concat,
u8  def
 

Yes/No user interface function.

Warning:
SIM Toolkit function, usable only in stk_thread().
Parameters:
text Text, ALPHA coding or unpacked STRING_SLV coding, can be from RAM, EEPROM, PROGMEM.
concat where 0 means no modification of text, Q_YESNO_DELETE_QMARK means modification to "Delete 'text'?", and Q_YESNO_QMARK means concat with '?', i.e. "text?"
def Default answer 0/1 (not applicable if PROC_8_CONFIG_BINARY_CHOICE set)
Returns:
APP_YES if yes, APP_NO if no, APP_BACK if user back, APP_END if user end.
Examples:
test_prot_mem.c, and tsmsacl.c.


Copyright © 2004-2006 BLADOX
Turbo version 1.2