@@ -344,10 +344,10 @@ def handle_report_init(self, hdr, sub, fd):
344344 self .serv_map [key ] = srv
345345
346346 def handle_report (self , hdr , sub , fd ):
347- if sub .type == 0x30 :
347+ if sub .type == EPICSubtype . ANNOUNCE :
348348 self .handle_report_init (hdr , sub , fd )
349349 else :
350- self .log (f"Report { sub .type :#x } " )
350+ self .log (f"Report { sub .type } " )
351351 chexdump (fd .read (), print_fn = self .log )
352352
353353 def handle_notify (self , hdr , sub , fd ):
@@ -391,7 +391,7 @@ def handle_reply(self, hdr, sub, fd):
391391 fd .seek (off )
392392 cmd = EPICCmd .parse_stream (fd )
393393 if not cmd .rxbuf :
394- self .log (f"Response { sub .type :#x } : { cmd .retcode :#x} " )
394+ self .log (f"Response { sub .type } : { cmd .retcode :#x} " )
395395 return
396396
397397 data = self .dart .ioread (self .stream , cmd .rxbuf , cmd .rxlen )
@@ -417,7 +417,7 @@ def handle_cmd(self, hdr, sub, fd):
417417 cmd = EPICCmd .parse_stream (fd )
418418 payload = fd .read ()
419419
420- if sub .type == 0xc0 and cmd .txbuf :
420+ if sub .type == EPICSubtype . STD_SERVICE and cmd .txbuf :
421421 data = self .dart .ioread (self .stream , cmd .txbuf , cmd .txlen )
422422 if len (data ) < 64 :
423423 self .log (f"EPIC: short cmd, len={ len (data )} " )
@@ -433,7 +433,7 @@ def handle_cmd(self, hdr, sub, fd):
433433 self .log (f"[???] > group { sgroup } command { scmd } " )
434434 chexdump (data [64 :64 + slen ], print_fn = lambda msg : self .log (f"[???] { msg } " ))
435435 else :
436- self .log (f"Command { sub .type :#x } : { cmd .retcode :#x} " )
436+ self .log (f"Command { sub .type } : { cmd .retcode :#x} " )
437437 if payload :
438438 chexdump (payload , print_fn = self .log )
439439 if cmd .txbuf :
0 commit comments