Skip to content

Commit

Permalink
hv/trace_dcp: Fix EPICSubheader enum type breakage
Browse files Browse the repository at this point in the history
Really should move this to an EPIC tracer

Signed-off-by: Eileen Yoon <[email protected]>
  • Loading branch information
eiln committed Jan 23, 2024
1 parent aa0f71b commit 5883a96
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions proxyclient/hv/trace_dcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def update_wptr(self):
raise NotImplementedError()

def get_wptr(self):
return struct.unpack("<I", self.read_buf(2 * self.BLOCK_SIZE, 4))[0]
return struct.unpack("<I", self.read_buf(2 * self.BLOCK_STEP, 4))[0]

def read_buf(self, off, size):
return self.ep.dart.ioread(self.ep.stream, self.base + off, size)
Expand Down Expand Up @@ -144,15 +144,15 @@ def handle_ipc(self, data, dir=None):

@msg(0x8a, DIR.RX, AFKEP_InitRB)
def InitTX(self, msg):
off = msg.OFFSET * AFKRingBuf.BLOCK_SIZE
size = msg.SIZE * AFKRingBuf.BLOCK_SIZE
off = msg.OFFSET * AFKRingBuf.BLOCK_STEP
size = msg.SIZE * AFKRingBuf.BLOCK_STEP
self.state.txbuf_info = (off, size)
self.create_bufs()

@msg(0x8b, DIR.RX, AFKEP_InitRB)
def InitRX(self, msg):
off = msg.OFFSET * AFKRingBuf.BLOCK_SIZE
size = msg.SIZE * AFKRingBuf.BLOCK_SIZE
off = msg.OFFSET * AFKRingBuf.BLOCK_STEP
size = msg.SIZE * AFKRingBuf.BLOCK_STEP
self.state.rxbuf_info = (off, size)
self.create_bufs()

Expand Down Expand Up @@ -307,7 +307,7 @@ def handle_ipc(self, data, dir=None):
sub = EPICSubHeader.parse_stream(fd)

self.log(f"{dir}Ch {hdr.channel} Type {hdr.type} Ver {hdr.version} Tag {hdr.seq}")
self.log(f" Len {sub.length} Ver {sub.version} Cat {sub.category} Type {sub.type:#x} Seq {sub.seq}")
self.log(f" Len {sub.length} Ver {sub.version} Cat {sub.category} Type {int(sub.type):#x}/{sub.type} Seq {sub.seq}")
# chexdump(data, print_fn=self.log)

if sub.category == EPICCategory.REPORT:
Expand Down

0 comments on commit 5883a96

Please sign in to comment.