Skip to content

Commit

Permalink
Add. command timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Kazenniy committed Feb 24, 2016
1 parent 1c3114a commit 61c7711
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions atapt/atapt.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ class atapt:
def __init__(self, dev):
self.smart = {}
self.ssd = 0
self.duration = 0
self.duration = 0
self.timeout = 1000
self.readCommand = ATA_READ_SECTORS
self.verifyCommand = ATA_READ_VERIFY_SECTORS
self.writeCommand = ATA_WRITE_SECTORS
Expand Down Expand Up @@ -239,7 +240,7 @@ def prepareSgio(self, cmd, feature, count, lba, buf):
dxfer_len=buf_len,
dxferp=buf_p,
cmdp=ctypes.addressof(ata_cmd),
sbp=ctypes.cast(self.sense, ctypes.c_void_p), timeout=1000,
sbp=ctypes.cast(self.sense, ctypes.c_void_p), timeout=self.timeout,
flags=0, pack_id=0, usr_ptr=None, status=0, masked_status=0,
msg_status=0, sb_len_wr=0, host_status=0, driver_status=0,
resid=0, duration=0, info=0)
Expand Down
2 changes: 1 addition & 1 deletion example/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
print("log. sector size: %d bytes" % disk.logicalSectorSize)
print("phys. sector size: %d bytes" % disk.physicalSectorSize)


disk.timeout = 1000
# Read SMART
print()
print("Read SMART")
Expand Down

0 comments on commit 61c7711

Please sign in to comment.