feat: the remaining six event types get their parameter forms

MT call, Call connected, Call disconnected, Browser termination, (I-)WLAN
access status and CSG cell selection no longer fall back to the generic
"send a bare notification" prompt:

- MT call (TS 31.111 7.5.1A.2): transaction identifier, calling party number
  + TON -> Address (EFADN BCD coding, encBcdDigits/eventAddressTlv),
  subaddress, IMS URI, media type; source network.
- Call connected (7.5.2A.2) / Call disconnected (7.5.3A.2): transaction
  identifier, near/far-end source select, media type, and a cause - absent,
  the zero-length radio-link-timeout form or custom bytes (the hex field shows
  only for "custom").
- Browser termination (TS 102 223 7.5.9.2): user / error cause.
- (I-)WLAN access status (TS 31.111 7.5.1.2): no coverage / coverage /
  connection on-going.
- CSG cell selection (TS 31.111 7.5.3.2): status + selection mechanism,
  optional access technology, CSG ID, HNB name and PLMN ID; source network.

The device-identities source (TS 102 223 8.7: 82 terminal / 83 network) is now
selectable: EVENT_FORMS carries a fixed `src` or a `srcField`, and
_send_event_download()/`/api/event-send` take an `event_src` override (an
invalid value falls back to the terminal).

Tests: the BCD/Address builders, each event's build vectors, the "no not_yet
left" guard and the server source override.  Help EN/RU, both AGENTS files;
sw cache simple-v348.
This commit is contained in:
2026-10-01 22:19:55 +03:00
parent 994ee6d2a3
commit a26a2b6648
7 changed files with 219 additions and 14 deletions
+11 -2
View File
@@ -789,7 +789,7 @@ class TestProactiveDecode(unittest.TestCase):
class TestEventDownload(unittest.TestCase):
"""ENVELOPE (EVENT DOWNLOAD) assembly, TS 102 223 7.5.11."""
def _send(self, event_type, event_data):
def _send(self, event_type, event_data, src=None):
import pysim_simple_server.server as srv
calls = []
@@ -802,7 +802,7 @@ class TestEventDownload(unittest.TestCase):
cat_cla = '80'
_tp = Tp()
data, sw = srv._send_event_download(Scc(), event_type, event_data)
data, sw = srv._send_event_download(Scc(), event_type, event_data, src=src)
return calls[0], sw
def test_channel_status_event(self):
@@ -817,6 +817,15 @@ class TestEventDownload(unittest.TestCase):
self.assertEqual(sw, '9000')
self.assertEqual(apdu, '80c2000009d60799010582028281')
def test_event_source_device_identity_can_be_overridden(self):
# MT call / CSG cell selection come from the network (TS 102 223 8.7)
apdu, sw = self._send(0x00, None, src='83')
self.assertEqual(sw, '9000')
self.assertEqual(apdu, '80c2000009d60799010082028381')
# an invalid source falls back to the terminal
apdu, sw = self._send(0x00, None, src='zz')
self.assertEqual(apdu, '80c2000009d60799010082028281')
def test_event_with_long_data_uses_the_ber_long_form(self):
# 128+ bytes of event data: the D6 length becomes '81' <len> (the
# 7.5.x tables allow 1 or 2 length bytes; a raw byte above 0x7F would