Skip to content

Commit

Permalink
diagwcdmalogparser: move old comments to test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
peremen committed Apr 23, 2024
1 parent 29ecb9d commit 7423176
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/scat/parsers/qualcomm/diagwcdmalogparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ def __init__(self, parent):
self.process = {
# Layer 1
i(c.LOG_WCDMA_SEARCH_CELL_RESELECTION_RANK_C): lambda x, y, z: self.parse_wcdma_search_cell_reselection(x, y, z),
#0x4179 WCDMA PN Search Edition 2
# 05 00 01 94 FE 00 02 00 02 00 02 00 FE 00 FE 00 A7 29 FF FF FF FF FF FF 00 00 01 04 01 23 00 00 CB 69 D0 18 C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5C 51 03 00 AC 4F 03 00 F8 52 03 00 24 51 03 00 18 54 03 00 04 54 03 00 08 02 00 00 78 00 00 00 78 00 00 00 74 00 00 00 71 00 00 00 70 00 00 00
# 05 00 01 74 FE 00 02 00 02 00 02 00 FE 00 FE 00 A7 29 FF FF FF FF FF FF 00 00 02 04 01 23 00 00 CB 69 D0 18 C0 00 04 01 23 00 00 56 5C 50 12 C0 00 04 00 00 00 00 00 00 00 00 00 00 00 00 5C 51 03 00 48 4F 03 00 88 4E 03 00 4C 51 03 00 2C 52 03 00 6C 52 03 00 BE 03 00 00 86 00 00 00 7E 00 00 00 75 00 00 00 6F 00 00 00 6F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 B8 E5 02 00 3C E6 02 00 24 E8 02 00 08 E3 02 00 9C E3 02 00 80 E5 02 00 98 02 00 00 7F 00 00 00 78 00 00 00 77 00 00 00 77 00 00 00 76 00 00 00
#0x41B0 WCDMA Freq Scan
# 01 03 1E FE 01 A3 FF A7 29

# Layer 2
i(c.LOG_WCDMA_RLC_DL_AM_SIGNALING_PDU_C): lambda x, y, z: self.parse_wcdma_rlc_dl_am_signaling_pdu(x, y, z), # WCDMA RLC DL AM Signaling PDU
Expand Down
10 changes: 10 additions & 0 deletions tests/test_diagwcdmalogparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class TestDiagWcdmaLogParser(unittest.TestCase):
parser = DiagWcdmaLogParser(parent=None)
log_header = namedtuple('QcDiagLogHeader', 'cmd_code reserved length1 length2 log_id timestamp')

# Layer 1
def test_parse_wcdma_cell_search(self):
payload = binascii.unhexlify('82000000000000f1293200b6a5fff1f5ff000000000000f1293100b39effdedeff040000008000')
pkt_header = self.log_header(cmd_code=0x10, reserved=0, length1=len(payload) + 12, length2=len(payload) + 12,
Expand All @@ -20,6 +21,14 @@ def test_parse_wcdma_cell_search(self):
expected = 'WCDMA Search Cell: 2 3G cells, 0 2G cells\nWCDMA Search Cell: 3G Cell 0: UARFCN 10737, PSC 50, RSCP -95, Ec/Io -7.50\nWCDMA Search Cell: 3G Cell 1: UARFCN 10737, PSC 49, RSCP -98, Ec/Io -17.00'
self.assertEqual(result['stdout'], expected)

def test_parse_wcdma_pn_search_edition_2(self):
payload = binascii.unhexlify('05000194FE00020002000200FE00FE00A729FFFFFFFFFFFF0000010401230000CB69D018C000000000000000000000000000005C510300AC4F0300F8520300245103001854030004540300080200007800000078000000740000007100000070000000')
payload = binascii.unhexlify('05000174FE00020002000200FE00FE00A729FFFFFFFFFFFF0000020401230000CB69D018C0000401230000565C5012C000040000000000000000000000005C510300484F0300884E03004C5103002C5203006C520300BE030000860000007E000000750000006F0000006F000000000000000000000000000000B8E502003CE6020024E8020008E302009CE3020080E50200980200007F00000078000000770000007700000076000000')

def test_parse_wcdma_freq_scan(self):
payload = binascii.unhexlify('01031EFE01A3FFA729')

# Layer 2
def test_parse_wcdma_rlc_dl_am_signaling_pdu(self):
payload = binascii.unhexlify('0111010090000200201400')
payload = binascii.unhexlify('011101009000020020ca00')
Expand Down Expand Up @@ -49,6 +58,7 @@ def test_parse_wcdma_rlc_ul_pdu_cipher_packet(self):
result = self.parser.parse_wcdma_rlc_ul_pdu_cipher_packet(pkt_header, payload, None)
self.assertEqual(result['stdout'], 'WCDMA RLC Cipher UL PDU: LCID: 16, CK = 0x1, Algorithm = UEA1, Count C = 0x400c')

# RRC
def test_parse_wcdma_cell_id(self):
payload = binascii.unhexlify('f1250000a729000041852d0800000700d01802060200030f9d9c000001000000')
pkt_header = self.log_header(cmd_code=0x10, reserved=0, length1=len(payload) + 12, length2=len(payload) + 12,
Expand Down

0 comments on commit 7423176

Please sign in to comment.