With my USB FS/LS analyzer version, and the HLA that does the filtering for me, I want
the HLA to output the packet times such that, I could correlate, the output report along with
what I see on the screen and
With the Save the LLA to text file output.
So, my current experiment, appears to work reasonably well for my needs. Not sure how much the times are off.
What I am now doing is:
def __init__(self):
'''
Initialize HLA.
'''
self.base = 10 # commands choose.
if self.DisplayFormat == 'Hex':
self.base = 16
elif self.DisplayFormat == 'Dec':
self.base = 10
self.addr = None
self.endpoint = None
self.frame_start_time = None
self.frame_end_time = None
self.data_packet_save = None
self.frame_data = {'pid':'', 'pid2':''}
self.first_packet_start_time = None;
I added that last line in this section.
Then at the begin of decode I have:
def decode(self, frame: AnalyzerFrame):
if self.first_packet_start_time == None:
self.first_packet_start_time = frame.start_time
Later when I have a report item I wish to print:
start_bias_time = float(self.frame_start_time - self.first_packet_start_time)
if self.base == 10:
print(str(start_bias_time), ',', self.frame_data['pid'], ',', str(self.endpoint[0]), ',', str(self.addr[0]), ',', data_str)
else:
print(str(start_bias_time), ',', self.frame_data['pid'], ',', hex(self.endpoint[0]), ',', hex(self.addr[0]), ',', data_str)
And now my output report looks like it has some reasonable times output:
23.91371954 , SETUP , 0x0 , 0x0 , 0x80 0x6 0x0 0x1 0x0 0x0 0x40 0x0
23.91378884 , IN , 0x0 , 0x0 , 0x12 0x1 0x0 0x2 0x0 0x0 0x0 0x40 0x6a 0x5 0x74 0x3 0x11 0x1 0x1 0x2 0x3 0x1
23.99383474 , SETUP , 0x0 , 0x0 , 0x0 0x5 0xb 0x0 0x0 0x0 0x0 0x0
24.01368234 , SETUP , 0x0 , 0xb , 0x80 0x6 0x0 0x1 0x0 0x0 0x12 0x0
24.01375654 , IN , 0x0 , 0xb , 0x12 0x1 0x0 0x2 0x0 0x0 0x0 0x40 0x6a 0x5 0x74 0x3 0x11 0x1 0x1 0x2 0x3 0x1
24.01389326 , SETUP , 0x0 , 0xb , 0x80 0x6 0x0 0x6 0x0 0x0 0xa 0x0
As I mentioned, I am not sure how far I am off, but I think close enough that I can find data in the other places.