mirror of https://github.com/ARMmbed/mbed-os.git
				
				
				
			simplify gathering hex values
							parent
							
								
									4ff7ebbb3f
								
							
						
					
					
						commit
						37ec35f671
					
				| 
						 | 
					@ -115,16 +115,13 @@ class NfcTestParsers(PluginBase):
 | 
				
			||||||
                if data is not False:
 | 
					                if data is not False:
 | 
				
			||||||
                    started_read_data = True
 | 
					                    started_read_data = True
 | 
				
			||||||
                if started_read_data:  # read data until we see a }} pair
 | 
					                if started_read_data:  # read data until we see a }} pair
 | 
				
			||||||
                    line_values = ""
 | 
					 | 
				
			||||||
                    if "{{nfcmessage=" in line:
 | 
					                    if "{{nfcmessage=" in line:
 | 
				
			||||||
                        line_values = line[13:]
 | 
					                        line = line[13:] # trim header
 | 
				
			||||||
                    else:
 | 
					 | 
				
			||||||
                        line_values = line
 | 
					 | 
				
			||||||
                    values = self.find_all_hex_data(line_values, "([0-9a-f\s]*)")
 | 
					 | 
				
			||||||
                    if values is not False:
 | 
					 | 
				
			||||||
                        partial_data += value
 | 
					 | 
				
			||||||
                    if PluginBase.find_one(line, ".*(}})") is not False: # search for end marker
 | 
					                    if PluginBase.find_one(line, ".*(}})") is not False: # search for end marker
 | 
				
			||||||
                        started_read_data = False
 | 
					                        started_read_data = False
 | 
				
			||||||
 | 
					                        line = line[:-2] # trim closing }}
 | 
				
			||||||
 | 
					                    partial_data += line
 | 
				
			||||||
 | 
					                    if not started_read_data:
 | 
				
			||||||
                        results['nfcmessage'] = self.convert_from_hex(partial_data)
 | 
					                        results['nfcmessage'] = self.convert_from_hex(partial_data)
 | 
				
			||||||
                # t1t,t2t,t3t,isodep,nfcdef,t5t
 | 
					                # t1t,t2t,t3t,isodep,nfcdef,t5t
 | 
				
			||||||
                value = PluginBase.find_one(line, "{{protocols=(([\w]*,?)*)}}")
 | 
					                value = PluginBase.find_one(line, "{{protocols=(([\w]*,?)*)}}")
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue