Skip to content

Commit 37ec35f

Browse files
committed
simplify gathering hex values
1 parent 4ff7ebb commit 37ec35f

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

TEST_APPS/icetea_plugins/nfc_test_parsers.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,13 @@ def trace_parser(self, response):
115115
if data is not False:
116116
started_read_data = True
117117
if started_read_data: # read data until we see a }} pair
118-
line_values = ""
119118
if "{{nfcmessage=" in line:
120-
line_values = line[13:]
121-
else:
122-
line_values = line
123-
values = self.find_all_hex_data(line_values, "([0-9a-f\s]*)")
124-
if values is not False:
125-
partial_data += value
119+
line = line[13:] # trim header
126120
if PluginBase.find_one(line, ".*(}})") is not False: # search for end marker
127121
started_read_data = False
122+
line = line[:-2] # trim closing }}
123+
partial_data += line
124+
if not started_read_data:
128125
results['nfcmessage'] = self.convert_from_hex(partial_data)
129126
# t1t,t2t,t3t,isodep,nfcdef,t5t
130127
value = PluginBase.find_one(line, "{{protocols=(([\w]*,?)*)}}")

0 commit comments

Comments
 (0)