reHDDPrinter reads and handle conn type

This commit is contained in:
2025-12-06 23:29:05 +01:00
parent b85ff21648
commit 731a00a644
2 changed files with 9 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@ -43,10 +43,10 @@ class TDriveData(ctypes.Structure):
("caDriveShredDuration", ctypes.c_char * STR_BUFFER_SIZE),
("caDriveCapacity", ctypes.c_char * STR_BUFFER_SIZE),
("caDriveState", ctypes.c_char * STR_BUFFER_SIZE),
("caDriveConnectionType", ctypes.c_char * STR_BUFFER_SIZE),
("caDriveModelFamily", ctypes.c_char * STR_BUFFER_SIZE),
("caDriveModelName", ctypes.c_char * STR_BUFFER_SIZE),
("caDriveSerialnumber", ctypes.c_char * STR_BUFFER_SIZE),
("caDriveConnectionType", ctypes.c_char * STR_BUFFER_SIZE),
("caDriveReHddVersion", ctypes.c_char * STR_BUFFER_SIZE),
]
@ -102,12 +102,12 @@ def create_drive_objects(drive_info):
modelname=drive_info["driveModelName"],
capacity=int(drive_info["driveCapacity"]),
serialnumber=drive_info["driveSerialnumber"],
drive_connection_type=drive_info["driveConnectionType"],
power_on_hours=int(drive_info["driveHours"]),
power_cycle=int(drive_info["driveCycles"]),
smart_error_count=int(drive_info["driveErrors"]),
shred_timestamp=int(drive_info["driveShredTimestamp"]),
shred_duration=int(drive_info["driveShredDuration"]),
drive_connection_type=drive_info["driveConnectionType"],
)
rehdd_info = layouter.ReHddInfo(
@ -132,6 +132,7 @@ def worker(queue_id, test_mode=False):
"driveShredDuration": 0,
"driveCapacity": 42,
"driveState": "shredded",
"driveConnectionType": "sata",
"driveModelFamily": "modelFamily",
"driveModelName": "modelName",
"driveSerialnumber": "serial",
@ -166,10 +167,15 @@ def worker(queue_id, test_mode=False):
),
"driveCapacity": int(d.caDriveCapacity.decode().strip("\x00")),
"driveState": d.caDriveState.decode().strip("\x00"),
"driveConnectionType": d.caDriveConnectionType.decode().strip(
"\x00"
),
"driveModelFamily": d.caDriveModelFamily.decode().strip("\x00"),
"driveModelName": d.caDriveModelName.decode().strip("\x00"),
"driveSerialnumber": d.caDriveSerialnumber.decode().strip("\x00"),
"driveConnectionType": d.caDriveConnectionType.decode().strip("\x00"),
"driveConnectionType": d.caDriveConnectionType.decode().strip(
"\x00"
),
"driveReHddVersion": d.caDriveReHddVersion.decode().strip("\x00"),
}