Show destination address in MO SHORT MESSAGE CONTROL summaries
- _build_summary: append 'DA <tp_da>' after the SMSC part for the MO SHORT MESSAGE CONTROL envelope (the envelope decoder already stores the second address TLV as cmd.tp_da; the detail view already showed it) - test: constructed D5 envelope with SMSC + destination address - Backend-only, no version bump
This commit is contained in:
1 parent
500e764a1b
commit
04443878a7
2 files changed
+16
No files matched your search
@@ -3744,6 +3744,8 @@ def _build_summary(result):
|
|||||||
parts.append(cmd['text'])
|
parts.append(cmd['text'])
|
||||||
if cmd.get('smsc'):
|
if cmd.get('smsc'):
|
||||||
parts.append(f"SMSC {cmd['smsc']}")
|
parts.append(f"SMSC {cmd['smsc']}")
|
||||||
|
if cmd.get('tp_da'):
|
||||||
|
parts.append(f"DA {cmd['tp_da']}")
|
||||||
if cmd.get('events'):
|
if cmd.get('events'):
|
||||||
parts.append(', '.join(cmd['events']))
|
parts.append(', '.join(cmd['events']))
|
||||||
if cmd.get('address'):
|
if cmd.get('address'):
|
||||||
|
|||||||
@@ -108,6 +108,20 @@ class TestCatDecoding(unittest.TestCase):
|
|||||||
self.assertEqual(t['text'], 'Hi')
|
self.assertEqual(t['text'], 'Hi')
|
||||||
self.assertEqual(t['scts'], '2026-08-12 14:30:00 (UTC+03:00)')
|
self.assertEqual(t['scts'], '2026-08-12 14:30:00 (UTC+03:00)')
|
||||||
|
|
||||||
|
def test_envelope_mo_short_message_control(self):
|
||||||
|
# D5 envelope: device ids + SMSC address + destination address
|
||||||
|
# (first address TLV → smsc, second → tp_da).
|
||||||
|
r = decode_message(bytes.fromhex(
|
||||||
|
'80C2000018'
|
||||||
|
'D516820283818607919733824009F08607919721436587F9'
|
||||||
|
'9000'))
|
||||||
|
self.assertEqual(r['ins_name'], 'ENVELOPE')
|
||||||
|
self.assertEqual(r['cat_command'], 'MO SHORT MESSAGE CONTROL')
|
||||||
|
cmd = r['cmd']
|
||||||
|
self.assertEqual(cmd['smsc'], '+79332804900')
|
||||||
|
self.assertEqual(cmd['tp_da'], '+79123456789')
|
||||||
|
self.assertEqual(r['summary'], 'SMSC +79332804900, DA +79123456789')
|
||||||
|
|
||||||
|
|
||||||
class TestCommandTypeTables(unittest.TestCase):
|
class TestCommandTypeTables(unittest.TestCase):
|
||||||
def test_known_values(self):
|
def test_known_values(self):
|
||||||
|
|||||||
Reference in new issue
Block a user