feat: card-driven STATUS polling and the Poll Interval Negotiation event (v3.5.9)

- EVENT_NAMES (server + PWA) corrected against TS 102 223 v18.3.0 8.25:
  0x14 is "Access technology change (multiple)" (not Change of UICC
  Access), 0x19 Profile container, 0x1A Void, 0x1B Secured profile
  container, 0x1C Poll interval negotiation, 0x20-0x22 reserved.  Values
  the CAT spec leaves "Reserved for 3GPP" now carry the concrete TS 31.111
  event name + clause (0x11 (I-)WLAN access status, 0x12 Network
  rejection, 0x15 CSG cell selection, 0x17 IMS registration, 0x18 Incoming
  IMS data, 0x1D Data connection status change, 0x1E CAG cell selection,
  0x1F Slices status change).
- Poll Interval Negotiation (0x1C) in the Phone tab: the form proposes a
  Duration (unit + interval) and the UICC's answer (TS 102 223 8.97
  accepted / rejected / modified + optional Duration) is decoded and
  shown; a "modified" duration becomes the background poll interval.  The
  form appears when the card subscribed to the event, like every other.
- Polling emulation is card-driven: a POLL INTERVAL adopts its Duration
  (minutes/seconds/tenths -> 1..255 s, logged) for the background poll,
  is echoed in the TERMINAL RESPONSE (6.8.4) and clears a POLLING OFF
  suspension; POLLING OFF (6.4.14) suspends proactive polling until a new
  POLL INTERVAL - the manual Send STATUS button and presence detection are
  unaffected.  /api/poll-status and /api/poll-toggle report card_disabled
  (+ a warning when enabling while suspended); the PWA shows it in amber.
- Tests: tests/test_poll.py +7, test_proactive_names.py +3, frontend
  event_forms +2 and poll_ui (4).  Help EN/RU, docs/api.md, AGENTS.

573 frontend / 439 Python green; version 3.5.9; sw cache simple-v262.
This commit is contained in:
2026-09-26 12:56:18 +03:00
parent d9e6c6c9dd
commit 25f001a778
11 changed files with 455 additions and 47 deletions
+22 -3
View File
@@ -616,6 +616,21 @@ optional hex for events that carry data. Returns the SW and any response data:
{"sw": "9000", "data": "..."}
```
For **Poll Interval Negotiation** (event `0x1C`, TS 102 223 §7.5.22) the
proposal rides in `event_data` as the Duration TLV `04 02 <unit> <interval>`
(unit `00` minutes / `01` seconds / `02` tenths of seconds) and the UICC's
response is decoded into `negotiation`:
```json
{"sw": "9000", "data": "1101020402011E",
"negotiation": {"result": 2, "result_name": "modified",
"unit": 1, "interval": 30, "seconds": 30}}
```
`result` is `00` accepted / `01` rejected / `02` modified (§8.97); no response
data means *accepted*. A *modified* answer sets the background poll interval,
and a *rejected* answer may carry the closest acceptable duration.
Channel status (event `0x0A`, TS 102 223 §8.56) carries the Channel status TLV
`B8 02 <status> <info>`, where the status byte is the channel id (1–7) OR-ed
with the state bits (0x00 link not established / 0x40 TCP LISTEN / 0x80 link
@@ -755,10 +770,12 @@ Hex, even number of digits, 1–255 bytes. Response is the same shape as
### `GET /api/poll-status`
Background STATUS polling state.
Background STATUS polling state. `card_disabled` is true after the card sent
POLLING OFF (TS 102 223 §6.4.14): proactive polling stays suspended until a
POLL INTERVAL arrives, independent of the operator's `enabled` switch.
```json
{"enabled": true, "interval": 300}
{"enabled": true, "interval": 30, "card_disabled": false}
```
### `POST /api/poll-toggle`
@@ -769,7 +786,9 @@ Turns background STATUS polling on or off.
{"enabled": true}
```
Returns the new state (`{"enabled": ..., "interval": ...}`).
Returns the new state (`{"enabled": ..., "interval": ..., "card_disabled": ...}`);
while the card has disabled polling, enabling adds a `warning` explaining
that the timer stays suspended until the card sends a new POLL INTERVAL.
### `GET /api/pli-qualifiers`