Sim Toolkit Application (STK)

STK相关总结 STK简介 一.SIM卡应用工具包(SIM Application Toolkit),又名CAT/USAT,它包含一系列终端与SIM卡的交互指令,SIM卡可以应用卡内的小应用程序和终端交互,从而实现增值服务的目的,STK包括三种类,STK-imsi切换,STK –OTA,STK-BIP 功能: (1) Profile download:配置下载,开机初始化SIM卡过程中,终端告诉SIM卡终端支持哪些功能,STK中download指终端将数据发送给SIM卡 (2) Proactive command: 主动式 阅读详情

This document offers a high-level overview of the SIM Toolkit Application for Android 1.0 and is primarily of interest for implementors of the Radio Interface Layer (RIL). The STK is R96 compatible (3GPP TS 11.14 v5.9.0) and complies partially with R99 (3GPP TS 101.267 v8.17.0). See the STK Feature List for the complete feature list.

The Android STK implementation includes three layers:

  • STK RIL: Low-level layer provided by the vendor plus libril.
  • STK Telephony: Protocol translation layer that converts raw messages provided by the STK RIL to application level messages.
  • STK Application: Provides the user interface interactions needed by the STK.


STK schema

The Sim Toolkit communication flow is bi-directional and commands can originate from the STK RIL packaged in RIL_UNSOL_STK_PROACTIVE_COMMAND, RIL_UNSOL_STK_EVENT_NOTIFY, RIL_UNSOL_REFRESH and RIL_UNSOL_STK_SESSION_END messages.

Commands originating from the STK App or STK Telephony layers are packaged in RIL_REQUEST_STK_SEND_TERMINAL_REPSONSE, RIL_REQUEST_SEND_ENVELOPE_COMMAND or RIL_REQUEST_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM.

For commands sent or recieved by the STK RIL, it's not necessary to remove unused sub-commands because the upper layers will gracefully ignore unused information contained in the message. The content of each message is encoded in the BER-TLV format except for two:

  • RIL_UNSOL_STK_SESSION_END: has no data
  • RIL_REQUEST_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM: has a single byte of data that indicates accept/reject.

See the Android Platform Development Kit for details.

Communication from the RIL up

Communication to the upper layers is done using the RIL_UNSOL_xxx family of commands defined in /hardware/ril/include/ril.h. The payload for each command is encoded using BER-TLV. As stated above, it is not necessary to remove extraneous fields. This allows the SIM to pass a complete command to the upper layers and simplifies STK RIL code. Below is the mapping from RIL_UNSOL_xxx commands to the SIM commands.

RIL_UNSOL_STK_PROACTIVE_COMMAND

The Sim Toolkit communication flow is bi-directional and commands can originate from the STK RIL packaged in RIL_UNSOL_STK_PROACTIVE_COMMAND, RIL_UNSOL_STK_EVENT_NOTIFY, RIL_UNSOL_REFRESH and RIL_UNSOL_STK_SESSION_END messages.

DISPLAY TEXT (6.4.1)

This command is handled by StkDialogActivity. If the immediate response flag is set, the terminal response is sent with an "OK" (0x00) result code when the message is first received. Otherwise the terminal response is sent when the dialog is dismissed either from user action or it times out.

The user sees a dialog box with a message and / or icon, an OK button, and a Cancel button.

Terminal responses include:

  • "OK" (0x00)
  • "Session terminated by user" (0x10)
  • "Backward move by user" (0x11)
  • "No response from user" (0x12)
GET IN KEY (6.4.2)

This command is processed by StkInputActivity. It displays a dialog box with a prompt and or an icon and yes and no buttons.

Terminal responses include:

  • “OK” (0x00) with “Yes” or “No” as the response text
  • “Session terminated by user” (0x10) << Currently not supported
  • “Backward move by user” (0x11)
  • “No response from user” (0x12)
GET INPUT (6.4.3)

This command is handled by StkInputActivity.

The user sees a dialog box with a prompt and / or an icon, a text box with optional default text, and an OK button. 'digits only,' 'min,' 'max,' and 'hidden' modes are all supported.

Terminal responses include:

  • OK” (0x00) if the input criteria is met
  • “Session terminated by user” (0x10) << Currently not supported
  • “Backward move by user” (0x11)
  • “No response from user” (0x12)
PLAY TONE (6.4.5)

This command is processed by ToneDialog.

The user sees a dialog box with a prompt for the duration of the tone or until the user presses the back key.

Terminal responses include:

  • "OK" (0x00) if the tone is played to completion
  • “Session terminated by user” (0x10) if back button is pressed
SET UP MENU (6.4.8)

This command is processed by StkAppService. It installs the STK ICON on the home page and prepares the Main menu for use when the ICON is selected. Typically this is the first RIL unsolicited command and should not be sent until after the RIL_RadioFunctions.getVersion routine is called.

Terminal reponses:

  • “OK” (0x00)

At a later time, the STK ICON will be selected and StkMenuActivity will launch and display the Main menu to the user. If an item is selected, it will be returned to the RIL in RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND with the item id. If no item is selected, the StkMenuActivity will receive a timeout message and return to the Main menu and no message will be sent to the RIL.

Depending upon what item is selected, the SIM may perform another action, such as sending another set of menu items via a SELECT ITEM command or performing an action like send an SMS or text display.

SELECT ITEM (6.4.9)

This command is processed by StkMenuActivity. Instead of displaying the Main menu, the list of menu items provided in this command are displayed.

Terminal responses:

  • “OK” (0x00)

The command then proceeds as in the SETUP MENU.

SET UP IDLE MODE TEXT (6.4.22)

StkAppService displays the message and or icon as an Android notification.

Terminal responses include:

  • OK” (0x00)
LAUNCH BROWSER (6.4.26)

This command is initially handled by StkDialogActivity and presents the user with a confirmation dialog, a URL, and OK, and cancel buttons. If the user presses OK, the browser is launched using the URL.

Terminal responses include:

  • “OK” (0x00) the browser has been launched
  • “Session terminated by user” (0x10)
  • “Backward move by user” (0x11)
  • “No response from user” (0x12)
RIL_UNSOL_STK_EVENT_NOTIFY

The commands in this section are proactive in nature. They are handled by the STK RIL and the upper layers and delivered using RIL_UNSOL_STK_EVENT_NOTIFY message. This distinction is an implementation detail of Android and is not defined in the 3GPP sepcifications.

The upper layers handle the UI and the STK RIL handles all other aspects of each command, which means that the STK RIL sends the terminal response (it is never sent by the STK App). Each command must be a properlery-formed proactive command. It is not necessary to remove unused fields. The behavior of any other command within this context sent by RIL_UNSOL_STK_EVENT_NOTIFY is undefined. See Event Notify Command Details.

  • SEND SMS (6.4.10) – no response
  • SEND SS (6.4.11) – no response
  • SEND USSD (6.4.12) – no response
  • SET UP CALL (6.4.13) – responds with RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM
  • SEND DTMF (6.4.24) – no response
RIL_UNSOL_SIM_REFRESH

Used to send the REFRESH command. No response.

REFRESH (6.4.7)

RIL_UNSOL_STK_SESSION_END

Sent by the SIM to signal the end of a session. No content and no response.

RIL_UNSOL_STK_SESSION_END

Sent by SIM to signal end of session. No content and no response.

Communication from the application down

Communication from the upper layers to the RIL uses the commands below (defined in ril.h):

RIL_REQUEST_STK_SEND_TERMINAL_REPSONSE

Used to send a terminal response for commands sent via RIL_UNSOL_STK_PROACTIVE_COMMAND.

Contents include TERMINAL RESPONSE (6.8).

RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND

Used to send information from to SIM encoded as BER-TLV tags (see R96 section 13). Two tags are supported:

  • BER_MENU_SELECTION_TAG (0xd3); Contents: MENU SELECTION (8)
  • BER_EVENT_DOWNLOAD_TAG (0xd6); Contents: EVENT DOWNLOAD Language selection (11.8)

Content for these tags include:

  • MENU SELECTION (8)
  • EVENT DOWNLOAD Language selection (11.8)
RIL_REQUEST_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM

Returns a single-byte parameter:

  • 1: accepted
  • 0: not accepted

This should cause the terminal response to be sent to the SIM.

Telephony

STK Telephony is a protocol translation layer used to convert messages from BERL-TLV format to Application messages and back.

On the STK RIL side, STK Telphony receives raw buffer messages from RIL I/F and decodes them into a command parameters container before passing them on to the application. On the Application side, this layer receives application responses for commands and encodes them into raw buffer messages, which then get sent over the RIL I/F back to the SIM card.

Feature List

Feature

Support

Implemented by

PROFILE DOWNLOAD - before radio turn-on

YES

Baseband

SET UP MENU

YES

ME

SELECT ITEM 

YES

ME

GET INPUT

YES

ME

GET INKEY

YES

ME

DISPLAY TEXT

YES

ME

SET UP IDLE MODE TEXT   

YES

ME

SEND SHORT MESSAGE 

YES

Baseband – ME

SEND SS 

YES

Baseband – ME

SEND USSD

YES

Baseband – ME

SEND DTMF

YES

Baseband – ME

LAUNCH BROWSER

YES

ME

SET UP CALL

YES

Baseband – ME

PLAY TONE

YES

ME

POLL INTERVAL

YES

Baseband

POLLING OFF

YES

Baseband

TIMER MANAGEMENT 

YES

Baseband

MORE TIME

YES

Baseband

PROVIDE LOCAL INFORMATION (MCC, MNC, LAC, Cell ID & IMEI)

YES

Baseband

PROVIDE LOCAL INFORMATION (NMR)

YES

Baseband

PROVIDE LOCAL INFORMATION (Timing Advance)

YES

Baseband

PROVIDE LOCAL INFORMATION(battery state)

YES

Baseband

PROVIDE LOCAL INFORMATION (IMEISV)

YES

Baseband

PROVIDE LOCAL INFORMATION (NMR(UTRAN))

YES

Baseband

PROVIDE LOCAL INFORMATION (Search Mode change)

YES

Baseband

REFRESH

YES

ME

SET UP EVENT LIST 

YES

Baseband – ME

Event: MT call

YES

Baseband

Event: Call connected (all modes)

YES

Baseband

Event: Call disconnected (all modes)

YES

Baseband

Event: Idle screen available

NO

 

Event: Browser termination

NO

 

Event: Location status 

YES

Baseband

Event: Data available

NO

 

Event: Channel status

NO

 

Event: Access Technology changed

YES

Baseband

Event: Local Connection

NO

 

Event: Network Search Mode Change

YES

Baseband

GET READER STATUS

NO

 

POWER ON CARD

NO

 

POWER OFF CARD

NO

 

PERFORM CARD ADPU

NO

 

RUN AT COMMAND

NO

 

OPEN CHANNEL

NO

 

CLOSE CHANNEL 

NO

 

RECEIVE DATA

NO

 

SEND DATA

NO

 

GET CHANNEL STATUS

NO

 

CALL CONTROL BY SIM

YES

Baseband

SMS-PP data download

YES

Baseband

SMS-CB data download

YES

Baseband

BIP over GPRS 

NO

 

BIP over USB

NO

 

Text Attributes  

NO

 

Color icons

YES

ME


stk 第1章 STK流程分析 第1章 STK流程分析 说一下和显示有关的几个类: StkDialogActivity:负责建立插卡后的所有弹窗(如:“欢迎使用中国国联通”)。 StkMenuActivity:负责插卡后的建立所有列表(如:进入SIM卡工具包-各菜单列表)。 StkAppInstaller:负责“SIM卡工具包”应用的图标显示(如:我们下载QQ后,桌面会有一个企鹅)。 1.1 PhoneApp实例化Ph... 阅读详情

相关推荐

STK call域选择介绍

STK call过程中经常会遇到终端de-registerIMS或者弹框提示错误。

weixin_51894735的博客 527

android之Sim Tool Kit流程分析

一.简介       STK 或者 UTK 就是 Sim Tool Kit (sim卡工具包),定制了一系列与运营商相关的应用(查询天气,话费,彩铃等),可以理解为安装在SIM卡上的应用。运营商将相关应用信息保存在SIM卡中,STK应用需要从SIM卡中读取相关应用信息,SIM卡也会向STK应用主动上报应用信息。      我们知道SIM卡是插在Modem中的,要读取SIM卡的内容,就必须要

sjz4860402的专栏 8477

USAT(USIM Application Toolkit)技术与BIP协议

USAT(USIM Application Toolkit)技术与BIP协议

gender123的博客 6158

STK(SIM TOOL KIT)

STK:STK(SIM TOOL KIT),简称“用户识别应用发展工具”,可以理解为一组开发增值业务的命令,一种小型编程语言,它允许基于智能卡的用户身份识别模块SIM运行自己的应用软件。STK卡不是一般的通常使用的SIM卡,而是基于Java语言平台的Simera32K卡片。STK是一种小型编程语言的软件,可以固化在SIM卡中。STK技术主要应用于手机银行、股票交易、外汇买卖、理财秘书等领域

曹浩洋的专栏 5219

SIM800AT命令手册

最新sim800系列AT命令手册。SIM800 Series_AT Command Manual_V1.08

SIM-TOOLKIT.rar_Sim toolkit

SIM300Z TO CONECT SMS AND MOBIPHONE

STK开发简介

    SIM卡最初用来储存电话号码、短消息和用户个人资料。卡内处理器在认证和编码时进行计算。它完全从属于手机。GSM标准的演进带来全新的概念—— SAT,它使电话在某些时候不再授命而是听命于SIM卡处理器内的应用,从而通过一些命令就可进行与人的双向反应。    SAT或SAT技术使营运商很容易通过SMS或小区广播来更更新用户的SIM卡设置或提供新的服务。SAT应用在服务器端运行于JAVA环境,服

WB.HUANG's TIPs 4789

Tessent --- PDL

当关联的ICL模块是当前ICL顶部模块时,即当它与当前设计匹配时,只能iCall一个iTopProc。但是,可以在iTopProc内调用iCall iProc或iTopProc。为指定后续iProc命令引用的ICL模块,发出这个命令之后,随后定义的iProc都会对应的ICL模块进行定义。为后续iCall调用,当使用iCall命令调用该过程时,参数列表中的变量将被替换为iCall命令中指定的值。在调用iProc时,运行iProc内的命令。PDL是面向工程师的,工程师利用PDL语言,对ICL中的单元进行控制。

qiantianyiqian的博客 2809

stk 入门

STK(SIM Application Toolkit),中文名为SIM卡应用工具包。它包含一系列手机与SIM卡的交互指令,SIM卡可以运行卡内的小应用程序与手机以及用户进行交互,从而实现增值服务的目的。 别名: CAT:Card Application Toolkit,另一个常用名,Android的STK应用就被命名为CatApp USAT:USIM Application Too

FIGHTING!!! 3217

BCIC IV 2a数据集实战:从MATLAB导入到EEG信号分析全流程

本文提供了BCIC IV 2a数据集从MATLAB导入到EEG信号分析的完整实战流程。详细解析了数据集结构,区分了EEG与EOG信号,并演示了信号可视化、基础预处理(滤波、分段、基线校正)等关键步骤,帮助脑机接口研究者快速上手处理这一经典运动想象数据集。

weixin_29047919的博客 477

椭圆 —— 从理论推导到最小二乘法拟合

前言 椭圆在高中数学里就开始提到,都是从标准方程开始如: x2a2+y2b2=1(a>b>0) \frac{x^2}{a^2}+\frac{y^2}{b^2}=1(a>b>0) a2x2​+b2y2​=1(a>b>0) 其中 aaa 为椭圆的长轴,bbb 为椭圆短轴。如长轴为 111 ,短轴为 0.50.50.5 的椭圆可以这样画出 ezplot('x^2/1^2 + y^2/0.5^2 = 1',[-1.5 1.5 -1 1]) grid on; 标准方程可以很方便

学徒浩子 2万+

STK Class

ETSI:ts_101267v080600p.pdf STK Class Support of SIM Application Toolkit is optional for Mobile Equipment. However, if an ME states conformancy with a specific GSM release, it is mandatory for th

xjbclz的专栏 632

【电机学复习笔记】同步电机的特性及参数的求取

同步电机的主要特性包括:空载特性、短路特性、零功率因数负载特性、外特性和调整特性。 基于以上特性我们可以实现: 从空载特性和短路特性求同步电抗的不饱和值和短路比; 从零功率因数负载特性和空载特性确定保梯电抗(定子漏抗)和电枢反应电动势

Pantrick_的博客 2万+

SAT总结

SAT(sim application toolkit),也可以称为STK ,是一种增值服务,运营商利用SAT为用户提供更加丰富多彩的增值服务。在传统功能里,手机是主导,SIM卡是从属,手机主动去读取SIM卡里的文件;但是在SAT功能里,SIM卡是主导,手机是从属,SIM卡主动要求手机做一些事情,例如显示欢迎语,显示SAT菜单之类的;或者要求手机把SIM卡感兴趣的事情告知SIM卡。一、SAT 常见...

sinat_34157462的博客 4112

【具身算法】VLA算法-Diffusion Policy

《扩散策略:多模态机器人控制的新方法》摘要 本文提出了一种基于扩散模型的机器人控制策略(DiffusionPolicy),用于解决视觉运动控制中的多模态行为、高维动作空间和训练稳定性问题。该方法利用去噪扩散概率模型(DDPM)生成动作序列,通过迭代优化处理复杂动作分布,显著提升了性能。实验表明,在15项机器人操作任务中,扩散策略平均性能提升46.9%,有效解决了传统显式/隐式策略的局限性。其核心优势在于:1)优雅建模多模态动作分布;2)适应高维动作空间;3)训练过程稳定。未来工作将探索与强化学习的结合及计算

puzhinan7781的博客 1401

OpenClaw常见4大赋能工作场景

OpenClaw不仅仅是一个AI工具,更像是个人与企业的“数字操作系统”——它连接大模型与真实世界,让“思考”与“行动”无缝闭环。

王国平的博客 629

STK入门

STK(SIM Application Toolkit)入门,包括功能介绍,工作流程,命令解析等。

柔情峡谷的博客 2万+

全功能爬虫框架:Botasaurus 的详细使用(现代化、反检测、高并发的智能爬虫框架)

Botasaurus是一个基于 Python 的全栈式智能数据采集框架。它深度融合了以下关键技术: 无头浏览器自动化(Headless Browser Automation):基于 Playwright 或 Puppeteer,支持 Chromium、Firefox、WebKit; 高级反检测引擎(Anti-Detection Engine):自动绕过 WebDriver、Canvas、AudioContext 等 50+ 种指纹检测; 声明式任务模型(Declarative Task Model):用装

数据知道的博客 4383

STK 维基百科解释

SIM Application Toolkit From Wikipedia, the free encyclopedia SIM Application Toolkit (commonly referred to as STK) is a standard of the GSM system which enables the Subscriber Identity Module

macrohasdefined的专栏 1286

《手把手教你玩转RTOS操作系统》专栏简介

《手把手教你玩转RTOS操作系统》专栏系统讲解实时操作系统开发,以FreeRTOS为主线,结合RT-Thread和Zephyr对比分析。内容涵盖RTOS基础、任务管理、通信机制、中断处理等核心知识,并配套STM32/ESP32平台实战项目。专栏特色在于零基础友好、实战驱动、多系统对比和行业趋势分析,适合嵌入式开发者进阶RTOS开发能力,解决实际项目中的选型与优化问题。通过完整学习路径,读者可掌握构建高可靠性嵌入式系统的关键技能。

MHD0815的博客 537

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

STK SIM TOOL KIT

STK(SIM TOOL KIT),简称“用户识别应用发展工具”,可以理解为一组开发增值业务的命令,一种小型编程语言,它允许基于智能卡的用户身份识别模块SIM运行自己的应用软件。   STK卡不是一般的通常使用的SIM卡,而是基于Java语言平台的Simera32K卡片。STK是一种小型编程语言的软件,可以固化在SIM卡中。它能够接收和发送GSM的短消息数据,起到SIM卡与短消息之间的接口的作用,

小九的专栏 3571

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

SIM Application Toolkit

SIM Application Toolkit 来源:simpleteam.com简单地介绍STK方面的开发   SIM卡最初用来储存电话号码、短消息和用户个人资料。卡内处理器在认证和编码时进行计算。它完全从属于手机。GSM标准的演进带来全新的概念——SAT,它使电话在某些时候不再授命而是听命于SIM卡处理器内的应用,从而通过一些命令就可进行与人的双向反应。    SAT或SAT技术使

harold2007的专栏 4550

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

上一篇: Radio Layer Interfac
下一篇: Dalvik
kuangjp
博客等级 码龄16年 11粉丝 20原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值