Skip to content

Commit

Permalink
squishy: scsi: Added a __repr__ for SCSICommand to show a bit mor…
Browse files Browse the repository at this point in the history
…e info
  • Loading branch information
lethalbit committed May 13, 2024
1 parent 172618c commit 3d3728a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions squishy/scsi/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,9 @@ def __init__(self, opcode: int, group_code: GroupCode, *subcons, size: int = Non
# if (self.sizeof() // 8) != self.command_size:
# raise RuntimeError(f'Structure is actually {self.sizeof() // 8} bytes long but must be {self.command_size} bytes long.')

def __repr__(self):
return f'\n<SCSICommand opcode:{self.opcode:02X} group:{self.group_code:X} fields: {len(self.subcons) - 2}>'

def len(self) -> int:
''' Return structure length in bytes '''

Expand Down

0 comments on commit 3d3728a

Please sign in to comment.