Хронологический список извлечённых проактивных команд. Каждая строка показывает время, код типа, имя и декодированный квалификатор (для команд, у которых он есть). Раскрытие строки показывает декодированную команду: текст и пункты DISPLAY TEXT / SELECT ITEM / SET UP MENU, параметры BIP-каналов, действия TIMER MANAGEMENT, названия квалификаторов PROVIDE LOCAL INFORMATION (все стандартные, включая ESN 07, MEID 0B и Supported RATs 1A) и SEND SHORT MESSAGE — разбирается SMS TPDU (тип, TP-MR, TP-DA, TP-PID, TP-DCS, срок действия, TP-UDL), а пользовательские данные показываются как текст для текстовых кодировок (GSM 7-бит, UCS2, 8-бит) или как secured-пакет (TS 31.115) при TP-PID = 7F (SIM data download); заголовки конкатенации UDH декодируются. Для команд с данными ответа показывается строка Ответ: с байтами TERMINAL RESPONSE (без служебных TLV); ответы PROVIDE LOCAL INFORMATION декодируются через словарь данных PLI.
6.4 TERMINAL PROFILE
-
Блок TERMINAL PROFILE (рядом с «STATUS и опрос») показывает действующий профиль (hex + число байт) и кнопки «Отправить» (повторная отправка, как «Спасение») и «Настроить». В диалоге настройки: селектор пресетов (модели устройств, например профиль BIP-совместимого аппарата из этого проекта), поле hex и форма с флажком на каждый бит профиля по TS 102 223 §5.2 (байты 1–33; далее — обобщённые подписи); переключение бита обновляет hex, а правка hex перерисовывает форму — поле hex основное, неизвестные байты и биты сохраняются. Кнопка «Применить» отправляет новое значение на сервер (и далее на карту), сбрасывая STK-сессию как «Спасение»; изменение хранится только в памяти (значение --terminal-profile — стартовое по умолчанию).
+
Блок TERMINAL PROFILE (рядом с «STATUS и опрос») содержит кнопки «Отправить» (повторная отправка, как «Спасение») и «Настроить». В диалоге настройки: селектор пресетов (модели устройств, например профиль BIP-совместимого аппарата из этого проекта), поле hex и форма с флажком на каждый бит профиля по TS 102 223 §5.2 (байты 1–33; далее — обобщённые подписи); каждый байт — вертикальный список битов; блоки размещены фиксированными группами (байты 1–12 в 2 колонки, 13–16 в 4, 17–18 в 2, 19–21 в 3, 22–25 в 2, 26–28 в 3, 29–30 в 2, далее по одному в строке); переключение бита обновляет hex, а правка hex перерисовывает форму — поле hex основное, неизвестные байты и биты сохраняются. Кнопка «Применить» отправляет новое значение на сервер (и далее на карту), сбрасывая STK-сессию как «Спасение»; изменение хранится только в памяти (значение --terminal-profile — стартовое по умолчанию).
6.5 Опрос STATUS
Кнопка Отправить STATUS отправляет STATUS (F2) вручную. Переключатель Опрос включает фоновый опрос: после настраиваемого интервала бездействия (аргумент сервера --poll-interval, 1–255 с, по умолчанию 30 с, 0 отключает опрос) сервер отправляет STATUS и обрабатывает любую ожидающую проактивную команду. При извлечении карты опрос останавливается, а состояние карты сбрасывается.
Chronological list of fetched proactive commands. Each row shows the elapsed time, type code, name, and a decoded qualifier (for commands that have one). Expanding a row shows the decoded command: DISPLAY TEXT / SELECT ITEM / SET UP MENU text and items, BIP channel parameters, TIMER MANAGEMENT actions, PROVIDE LOCAL INFORMATION qualifier names (all standard qualifiers, including ESN 07, MEID 0B and Supported RATs 1A), and SEND SHORT MESSAGE — the SMS TPDU is parsed (type, TP-MR, TP-DA, TP-PID, TP-DCS, validity period, TP-UDL) with the user data shown as text for text codings (GSM 7-bit, UCS2, 8-bit) or as a secured packet (TS 31.115) when TP-PID = 7F (SIM data download); UDH concatenation headers are decoded. Commands with response data show a Response: line with the TERMINAL RESPONSE bytes (boilerplate TLVs stripped); PROVIDE LOCAL INFORMATION responses are decoded using the PLI data dictionary decoders.
6.4 TERMINAL PROFILE
-
The TERMINAL PROFILE block (next to STATUS and Polling) shows the profile currently in effect (hex + byte count) and offers Send (re-sends it, like Rescue) and Configure. The Configure dialog has a preset selector (device models, e.g. this project's BIP-capable handset profile), a hex field and a form with one checkbox per profile bit decoded per TS 102 223 §5.2 (bytes 1–33; later bytes get generic labels); toggling a bit updates the hex and editing the hex re-renders the form — the hex field is authoritative and unknown bytes/bits are preserved. Apply sends the new value to the server (and on to the card), resetting the STK session like Rescue; the change is in-memory only (the --terminal-profile CLI value is the startup default).
+
The TERMINAL PROFILE block (next to STATUS and Polling) offers Send (re-sends it, like Rescue) and Configure. The Configure dialog has a preset selector (device models, e.g. this project's BIP-capable handset profile), a hex field and a form with one checkbox per profile bit decoded per TS 102 223 §5.2 (bytes 1–33; later bytes get generic labels), each byte is a vertical list of its bits, placed in fixed column groups (bytes 1-12 in 2 columns, 13-16 in 4, 17-18 in 2, 19-21 in 3, 22-25 in 2, 26-28 in 3, 29-30 in 2, later bytes one per row); toggling a bit updates the hex and editing the hex re-renders the form — the hex field is authoritative and unknown bytes/bits are preserved. Apply sends the new value to the server (and on to the card), resetting the STK session like Rescue; the change is in-memory only (the --terminal-profile CLI value is the startup default).
6.5 STATUS polling
A Send STATUS button issues a manual STATUS (F2). A Polling toggle enables background polling: after a configurable idle interval (server CLI --poll-interval, 1–255 s, default 30 s, 0 disables polling) the server sends STATUS and handles any pending proactive command. Polling stops and card state resets if the card is removed.
Bits are decoded per TS 102 223 5.2; the hex field is authoritative and bytes/bits outside the table are preserved as-is.
@@ -6967,10 +6964,15 @@ const PLI_QUALIFIERS = [
// annex bits; bytes 1..33). Index 0 = bit 1 = first byte b8; bit n is
// byte floor(n/8)+1, mask 0x80 >> (n%8). Bytes beyond 33 fall back to
// generic labels in the UI.
+// TERMINAL PROFILE bit allocation: bytes 1..39 per ETSI TS 102 223
+// V18.3.0 5.2, 3GPP-defined bits named per ETSI TS 131 111 V18.12.0 5.2
+// (no "reserved by 3GPP" placeholders). Index 0 = bit 1 = first byte b8;
+// bit n is byte floor(n/8)+1, mask 0x80 >> (n%8). Bytes beyond the
+// table fall back to generic labels in the UI.
const TP_BITS = [
'Profile download', 'SMS-PP data download', 'Cell Broadcast data download', 'Menu selection',
- 'SMS-PP data download', 'Timer expiration', 'USSD string DO support in CC by USIM', 'Call Control by NAA',
- 'Command result', 'Call Control by NAA', 'Call Control by NAA', 'MO short message control support',
+ 'SMS-PP data download', 'Timer expiration', 'USSD string data object support in Call Control by USIM', 'Call Control by NAA',
+ 'Command result', 'Call Control by NAA', 'Call Control by NAA', 'MO short message control by USIM',
'Call Control by NAA', 'UCS2 Entry supported', 'UCS2 Display supported', 'Display Text',
'Proactive UICC: DISPLAY TEXT', 'Proactive UICC: GET INKEY', 'Proactive UICC: GET INPUT', 'Proactive UICC: MORE TIME',
'Proactive UICC: PLAY TONE', 'Proactive UICC: POLL INTERVAL', 'Proactive UICC: POLLING OFF', 'Proactive UICC: REFRESH',
@@ -6980,7 +6982,7 @@ const TP_BITS = [
'Event: Location status', 'Event: User activity', 'Event: Idle screen available', 'Event: Card reader status',
'Event: Language selection', 'Event: Browser Termination', 'Event: Data available', 'Event: Channel status',
'Event: Access Technology Change', 'Event: Display parameters changed', 'Event: Local Connection', 'Event: Network Search Mode Change',
- 'Proactive UICC: POWER ON CARD', 'Proactive UICC: POWER OFF CARD', 'Proactive UICC: PERFORM CARD RESET', 'Proactive UICC: GET READER STATUS (Card reader status)',
+ 'Proactive UICC: POWER ON CARD', 'Proactive UICC: POWER OFF CARD', 'Proactive UICC: PERFORM CARD APDU', 'Proactive UICC: GET READER STATUS (Card reader status)',
'Proactive UICC: GET READER STATUS (Card reader identifier)', 'RFU', 'RFU', 'RFU',
'Proactive UICC: TIMER MANAGEMENT (start, stop)', 'Proactive UICC: TIMER MANAGEMENT (get current value)', 'Proactive UICC: PROVIDE LOCAL INFORMATION (date, time and time zone)', 'GET INKEY',
'SET UP IDLE MODE TEXT', 'RUN AT COMMAND', 'SETUP CALL', 'Call Control by NAA',
@@ -7001,24 +7003,24 @@ const TP_BITS = [
'RFU', 'RFU', 'RFU', 'RFU',
'RFU', 'RFU', 'RFU', 'RFU',
'BIP: TCP, UICC in client mode, remote connection', 'BIP: UDP, UICC in client mode, remote connection', 'BIP: TCP, UICC in server mode', 'BIP: TCP, UICC in client mode, local connection',
- 'BIP: UDP, UICC in client mode, local connection', 'BIP: direct communication channel', 'reserved by 3GPP (E-UTRAN)', 'reserved by 3GPP (HSDPA)',
+ 'BIP: UDP, UICC in client mode, local connection', 'BIP: direct communication channel', 'E-UTRAN', 'HSDPA',
'Proactive UICC: DISPLAY TEXT (variable timeout)', 'Proactive UICC: GET INKEY (help while waiting for immediate response or variable timeout)', 'USB (BIP supported bearer)', 'Proactive UICC: GET INKEY (variable timeout)',
- 'Proactive UICC: PROVIDE LOCAL INFORMATION (ESN)', 'reserved by 3GPP (Call control on GPRS)', 'Proactive UICC: PROVIDE LOCAL INFORMATION (IMEISV)', 'Proactive UICC: PROVIDE LOCAL INFORMATION (Search mode change)',
- 'reserved by TIA/EIA-136-270 (protocol version support)', 'RFU', 'RFU', 'RFU',
+ 'Proactive UICC: PROVIDE LOCAL INFORMATION (ESN)', 'CALL CONTROL on GPRS', 'Proactive UICC: PROVIDE LOCAL INFORMATION (IMEISV)', 'Proactive UICC: PROVIDE LOCAL INFORMATION (Search mode change)',
+ 'Protocol version support (TIA/EIA-136-270)', 'RFU', 'RFU', 'RFU',
'RFU', 'RFU', 'RFU', 'RFU',
- 'reserved by CCAT', 'reserved by CCAT', 'reserved by CCAT', 'reserved by CCAT',
- 'reserved by CCAT', 'reserved by CCAT', 'reserved by CCAT', 'reserved by CCAT',
+ 'Reserved for CCAT', 'Reserved for CCAT', 'Reserved for CCAT', 'Reserved for CCAT',
+ 'Reserved for CCAT', 'Reserved for CCAT', 'Reserved for CCAT', 'Reserved for CCAT',
'WML', 'XHTML', 'HTML', 'CHTML',
'RFU', 'RFU', 'RFU', 'RFU',
- 'reserved by 3GPP (UTRAN PS with extended parameters)', 'Proactive UICC: PROVIDE LOCAL INFORMATION (battery state)', 'Proactive UICC: PLAY TONE (melody/themed tones)', 'Multi-media calls in SET UP CALL',
- 'reserved by 3GPP (Toolkit-initiated GBA)', 'Proactive UICC: RETRIEVE MULTIMEDIA MESSAGE', 'Proactive UICC: SUBMIT MULTIMEDIA MESSAGE', 'Proactive UICC: DISPLAY MULTIMEDIA MESSAGE',
+ 'Support of UTRAN PS with extended parameters', 'Proactive UICC: PROVIDE LOCAL INFORMATION (battery state)', 'Proactive UICC: PLAY TONE (melody/themed tones)', 'Multi-media calls in SET UP CALL',
+ 'Toolkit-initiated GBA', 'Proactive UICC: RETRIEVE MULTIMEDIA MESSAGE', 'Proactive UICC: SUBMIT MULTIMEDIA MESSAGE', 'Proactive UICC: DISPLAY MULTIMEDIA MESSAGE',
'Proactive UICC: SET FRAMES', 'Proactive UICC: GET FRAMES STATUS', 'MMS notification download', 'Alpha identifier in REFRESH',
- 'reserved by 3GPP (Geographical location reporting)', 'Proactive UICC: PROVIDE LOCAL INFORMATION (MEID)', 'reserved by 3GPP (PLI NMR for multiple access technologies)', 'reserved by 3GPP/3GPP2 (USSD data download and application mode)',
+ 'Geographical Location Reporting', 'Proactive UICC: PROVIDE LOCAL INFORMATION (MEID)', 'Proactive UICC: PROVIDE LOCAL INFORMATION (NMR (UTRAN/E-UTRAN/Satellite E-UTRAN/NG-RAN/Satellite NG-RAN))', 'USSD Data download and application mode',
'Maximum number of frames supported (value field)', 'RFU', 'RFU', 'RFU',
'RFU', 'RFU', 'RFU', 'RFU',
- 'Event: Browsing status', 'Event: MMS transfer status', 'Event: Frame information changed', 'reserved by 3GPP (Event: I-WLAN access status)',
- 'reserved by 3GPP (Event: Network rejection)', 'Event: HCI connectivity', 'reserved by 3GPP (E-UTRAN in Event Network Rejection)', 'Multiple access technologies supported (Event Access Technology Change / PLI)',
- 'reserved by 3GPP (Event: CSG cell selection)', 'Event: Contactless state request', 'RFU', 'RFU',
+ 'Event: Browsing status', 'Event: MMS transfer status', 'Event: Frame information changed', 'Event: I-WLAN Access status',
+ 'Event: Network Rejection for GERAN/UTRAN', 'Event: HCI connectivity', 'Event: Network Rejection for E-UTRAN/Satellite E-UTRAN', 'Multiple access technologies supported (Event Access Technology Change / PLI)',
+ 'Event: CSG Cell Selection', 'Event: Contactless state request', 'RFU', 'RFU',
'RFU', 'RFU', 'RFU', 'RFU',
'RFU', 'RFU', 'RFU', 'RFU',
'RFU', 'RFU', 'RFU', 'RFU',
@@ -7026,14 +7028,26 @@ const TP_BITS = [
'Font size large', 'Font size small', 'RFU', 'RFU',
'Style normal', 'Style bold', 'Style italic', 'Style underlined',
'Style strikethrough', 'Style text foreground colour', 'Style text background colour', 'RFU',
- 'reserved by 3GPP (I-WLAN bearer)', 'reserved by 3GPP (PLI WSID of the current I-WLAN connection)', 'TERMINAL APPLICATIONS', 'reserved by 3GPP (Steering of Roaming REFRESH)',
+ 'I-WLAN bearer support', 'Proactive UICC: PROVIDE LOCAL INFORMATION (WSID of the current I-WLAN connection)', 'TERMINAL APPLICATIONS', '"Steering of Roaming" REFRESH support',
'RFU', 'RFU', 'RFU', 'RFU',
- 'Proactive UICC: Contactless State Changed', 'reserved by 3GPP (CSG cell discovery)', 'Confirmation parameters for OPEN CHANNEL in Terminal Server mode', 'reserved by 3GPP (Communication control for IMS)',
- 'CAT over the modem interface', 'reserved by 3GPP (Incoming IMS data event)', 'reserved by 3GPP (IMS registration event)', 'Proactive UICC: Profile/Envelope/Command Container, ENCAPSULATED SESSION CONTROL',
- 'reserved by 3GPP (IMS as BIP bearer)', 'reserved by 3GPP (PLI H(e)NB IP address)', 'reserved by 3GPP (PLI H(e)NB surrounding macrocells)', 'Launch parameters for OPEN CHANNEL in Terminal Server mode',
+ 'Proactive UICC: Contactless State Changed', 'Support of CSG cell discovery', 'Confirmation parameters for OPEN CHANNEL in Terminal Server mode', 'Communication Control for IMS',
+ 'CAT over the modem interface', 'Support for Incoming IMS Data event', 'Support for IMS Registration event', 'Proactive UICC: Profile/Envelope/Command Container, ENCAPSULATED SESSION CONTROL',
+ 'IMS support', 'Support of PROVIDE LOCAL INFORMATION, H(e)NB IP address', 'Support of PROVIDE LOCAL INFORMATION, H(e)NB surrounding macrocells', 'Launch parameters for OPEN CHANNEL in Terminal Server mode',
'Direct communication channel for OPEN CHANNEL in Terminal Server mode', 'Security for Profile/Envelope/Command Container and ENCAPSULATED SESSION CONTROL', 'CAT service list for eCAT client', 'Refresh enforcement policy',
- 'DNS server address request for OPEN CHANNEL (packet data bearer)', 'Network Access Name reuse indication for CLOSE CHANNEL', 'Event: Poll Interval Negotiation', 'reserved by 3GPP (ProSe usage information reporting)',
- 'Proactive UICC: PROVIDE LOCAL INFORMATION (Supported Radio Access Technologies)', 'reserved by 3GPP (Event: WLAN access status)', 'reserved by 3GPP (WLAN bearer)', 'reserved by 3GPP (PLI WLAN identifier)',
+ 'DNS server address request for OPEN CHANNEL (packet data bearer)', 'Network Access Name reuse indication for CLOSE CHANNEL', 'Event: Poll Interval Negotiation', 'ProSe usage information reporting',
+ 'Proactive UICC: PROVIDE LOCAL INFORMATION (Supported Radio Access Technologies)', 'Event: WLAN Access status', 'WLAN bearer support', 'Proactive UICC: PROVIDE LOCAL INFORMATION (WLAN identifier of the current WLAN connection)',
+ 'URI support for SEND SHORT MESSAGE', 'IMS URI supported for SET UP CALL', 'Media Type "Voice" supported for SET UP CALL and Call Control by USIM', 'Media Type "Video" supported for SET UP CALL and Call Control by USIM',
+ 'Proactive UICC: PROVIDE LOCAL INFORMATION (E-UTRAN Timing Advance Information)', 'REFRESH with "eUICC Profile State Change" mode', 'Extended Rejection Cause Code in Event: Network Rejection for E-UTRAN', 'Reserved for future use',
+ 'Proactive UICC: GET INPUT (Variable Time out)', 'Data Connection Status Change Event support – PDP Connection', 'Data Connection Status Change Event support – PDN Connection', 'REFRESH with "Application Update" mode',
+ 'Proactive UICC: LSI COMMAND with "Proactive session request"', 'Proactive UICC: LSI COMMAND with "UICC Platform Reset"', 'RFU', 'RFU',
+ 'Data Connection Status Change Event support – PDU Connection', 'Event: Network Rejection for NG-RAN', 'Non-IP Data Delivery support', 'Support of PROVIDE LOCAL INFORMATION, Slice(s) information',
+ 'REFRESH "Steering of Roaming" SOR-CMCI parameter support', 'Event: Network Rejection for Satellite NG-RAN', 'Support of CAG feature', 'Event: Slices Status Change',
+ 'Support of PROVIDE LOCAL INFORMATION, Rejected Slice(s) Information', 'Support of Extended information for PLI (Location Information), Event: Location Status, Event: Network Rejection', 'Support of chaining of PLI/Envelope commands', '5G ProSe usage information reporting',
+ 'Reserved for future use', 'Reserved for future use', 'Reserved for future use', 'Reserved for future use',
+ 'Reserved for future use', 'Reserved for future use', 'Reserved for future use', 'Reserved for future use',
+ 'Reserved for future use', 'Reserved for future use', 'Reserved for future use', 'Reserved for future use',
+ 'Proactive UICC: PROVIDE LOCAL INFORMATION (NG-RAN/Satellite NG-RAN Timing Advance Information)', 'Reserved for future use', 'Reserved for future use', 'Reserved for future use',
+ 'Reserved for future use', 'Reserved for future use', 'Reserved for future use', 'Reserved for future use',
];
// TERMINAL PROFILE presets (device/model -> profile hex). Add new entries
@@ -7041,6 +7055,13 @@ const TP_BITS = [
const TP_PRESETS = [
{ name: 'Xiaomi Mi A1 (BIP-capable handset, project default)', profile: 'FFFFFFFF7F9F00DFFF03021FE2000000C3FB000704117800710100000038428003' },
{ name: 'Quectel GSM module (AT+STKPD manual example)', profile: 'FFFFFFFF7F1F007FFF00001F230811060700' },
+ { name: 'Samsung S21+ 5G', profile: 'FFFFFFFF7F9D00DFFF00001FE2000000C3EB00000000400050000000000800000000' },
+ { name: 'Samsung A55 5G', profile: 'FFFFFFFF7F9D00DFFF00001FE2000000C3EB000000004000500000000008000003303002000001' },
+ { name: 'Xiaomi Redmi Note 10 LTE', profile: 'FFFFFFFF7F9F00FFFF03021FE2000000C3EB00000411580071000000003808800700' },
+ { name: 'Sony Xperia Z5c LTE', profile: 'FFFFFFFF7F9F00DFFF03071FE2080C00C3EB00000001480051000000000800' },
+ { name: 'Huawei E5573c / M150 (LTE)', profile: 'FFFFFFEF1F9C009B8500001F22000000C3CB000000010000900000000008' },
+ { name: 'Huawei E173 3G modem', profile: '2965D7E11F90001FD50000000000000000E00000' },
+ { name: 'Nokia 7210 2G', profile: 'FFFFFFFF7F3F00DFFF00001FE28A0D0203290000020040' },
];
function tpNorm(hex) { return (hex || '').toUpperCase().replace(/[^0-9A-F]/g, ''); }
@@ -7070,6 +7091,30 @@ function tpBitLabel(n) {
return 'RFU (byte ' + ((n >> 3) + 1) + ' b' + (8 - (n & 7)) + ')';
}
+// Fixed byte-block layout: [firstByte, lastByte, columns] with 1-based
+// inclusive ranges (0 = "to the end of the profile"). Each byte block is a
+// vertical bit list; the groups place the blocks in 1..4 columns.
+const TP_LAYOUT = [
+ [1, 12, 2],
+ [13, 16, 4],
+ [17, 18, 2],
+ [19, 21, 3],
+ [22, 25, 2],
+ [26, 28, 3],
+ [29, 30, 2],
+ [31, 0, 1],
+];
+
+function tpLayoutGroups(totalBytes) {
+ const groups = [];
+ for (const [from, to, cols] of TP_LAYOUT) {
+ const end = to === 0 ? totalBytes : Math.min(to, totalBytes);
+ if (from > end) continue;
+ groups.push({from: from, to: end, cols: cols});
+ }
+ return groups;
+}
+
function tpRenderForm() {
const el = document.getElementById('tp-form');
if (!el) return;
@@ -7077,18 +7122,25 @@ function tpRenderForm() {
if (!tpValid(hex)) { el.innerHTML = ''; return; }
const bytes = hex.length / 2;
let html = '';
- for (let bi = 0; bi < bytes; bi++) {
- html += '
' +
- esc(t('Byte')) + ' ' + (bi + 1) + '
';
- for (let k = 0; k < 8; k++) {
- const n = bi * 8 + k;
- const label = tpBitLabel(n);
- html += '';
+ for (const g of tpLayoutGroups(bytes)) {
+ html += '
';
+ for (let bi = g.from - 1; bi < g.to; bi++) {
+ html += '
';
+ html += '
' + esc(t('Byte')) + ' ' + (bi + 1) + '
';
+ for (let k = 0; k < 8; k++) {
+ const n = bi * 8 + k;
+ const mask = 'b' + (8 - k);
+ const label = tpBitLabel(n);
+ html += '';
+ }
+ html += '