From 8e6867350932aee8d799261854743a4059777426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D1=82=D0=BE=D0=BD=20=D0=A2=D1=80=D0=BE=D1=88?= =?UTF-8?q?=D0=B8=D0=BD?= Date: Wed, 16 Sep 2026 22:15:01 +0300 Subject: [PATCH] terminal profile: spec-audited bits, fixed layout, more presets (v2.2.10) TERMINAL PROFILE form (Phone simulator): - The compact block no longer shows the hex value (no room); Send + Configure + status remain. Preset selector sits above the hex field. - Bits are never spread horizontally: each byte is one vertical list. Byte blocks are placed by the fixed TP_LAYOUT 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, 31+ one per row - in strict byte order. Bit descriptions audited against the pinned specs: - Table regenerated from ETSI TS 102 223 V18.3.0 5.2 (bytes 1-39) with the 3GPP-defined bits named per ETSI TS 131 111 V18.12.0 5.2; the "reserved by 3GPP" placeholders are gone (tests guard this). - Fixes found in the audit: byte 7 b6 PERFORM CARD APDU (pySim had RESET), MO short message control by USIM, USSD string DO support in Call Control by USIM, the earlier "Data available" typo. - Presets: project default + Quectel example + Samsung S21+ 5G, Samsung A55 5G, Xiaomi Redmi Note 10 LTE, Sony Xperia Z5c LTE, Huawei E5573c/M150 (LTE), Huawei E173 3G modem, Nokia 7210 2G (9 total). Also fixes a page-load TDZ regression: the custom-files init (which calls t()) now runs after the language init (guard test added). SW cache otaman-v174; help EN/RU updated; tests 236 Python + 374 frontend. --- frontend/help-ru.html | 2 +- frontend/help.html | 2 +- frontend/index.html | 155 +++++++++++++++--------- frontend/sw.js | 2 +- frontend/tests/html.test.js | 7 ++ frontend/tests/terminal_profile.test.js | 69 +++++++++-- pyproject.toml | 2 +- pysim_otaman_server/server.py | 2 +- 8 files changed, 174 insertions(+), 67 deletions(-) diff --git a/frontend/help-ru.html b/frontend/help-ru.html index 7db50f2..3de52a0 100644 --- a/frontend/help-ru.html +++ b/frontend/help-ru.html @@ -432,7 +432,7 @@

Хронологический список извлечённых проактивных команд. Каждая строка показывает время, код типа, имя и декодированный квалификатор (для команд, у которых он есть). Раскрытие строки показывает декодированную команду: текст и пункты 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 и обрабатывает любую ожидающую проактивную команду. При извлечении карты опрос останавливается, а состояние карты сбрасывается.

diff --git a/frontend/help.html b/frontend/help.html index 03241f6..ea260e1 100644 --- a/frontend/help.html +++ b/frontend/help.html @@ -432,7 +432,7 @@

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.

diff --git a/frontend/index.html b/frontend/index.html index 0fd3035..991e7ba 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -18,7 +18,7 @@
-

OTAMan SIM OTA with a Human Face v2.2.3

+

OTAMan SIM OTA with a Human Face v2.2.10

@@ -926,7 +926,6 @@
TERMINAL PROFILE
-
Loading...
@@ -1155,15 +1154,13 @@