diff --git a/include/printer.h b/include/printer.h index b67a1e4..6fbfccf 100644 --- a/include/printer.h +++ b/include/printer.h @@ -26,11 +26,11 @@ typedef struct char caDriveShredDuration[STR_BUFFER_SIZE]; char caDriveCapacity[STR_BUFFER_SIZE]; char caDriveState[STR_BUFFER_SIZE]; + char caDriveConnectionType[STR_BUFFER_SIZE]; char caDriveModelFamily[STR_BUFFER_SIZE]; char caDriveModelName[STR_BUFFER_SIZE]; char caDriveSerialnumber[STR_BUFFER_SIZE]; char caDriveReHddVersion[STR_BUFFER_SIZE]; - } t_driveData; typedef struct diff --git a/src/printer.cpp b/src/printer.cpp index 7bf620a..0e8c60f 100644 --- a/src/printer.cpp +++ b/src/printer.cpp @@ -53,6 +53,23 @@ void Printer::print(Drive *drive) sprintf(msgQueueData.driveData.caDriveErrors, "%i", drive->getErrorCount()); sprintf(msgQueueData.driveData.caDriveShredTimestamp, "%li", drive->getActionStartTimestamp()); sprintf(msgQueueData.driveData.caDriveShredDuration, "%li", drive->getTaskDuration()); + + switch (drive->connectionType) + { + case Drive::USB: + strcpy(msgQueueData.driveData.caDriveConnectionType, "usb"); + break; + case Drive::SATA: + strcpy(msgQueueData.driveData.caDriveConnectionType, "sata"); + break; + case Drive::NVME: + strcpy(msgQueueData.driveData.caDriveConnectionType, "nvme"); + break; + case Drive::UNKNOWN: + default: + strcpy(msgQueueData.driveData.caDriveConnectionType, "na"); + } + sprintf(msgQueueData.driveData.caDriveReHddVersion, REHDD_VERSION); if (-1 == msgsnd(this->msqid, &msgQueueData, sizeof(t_msgQueueData) - sizeof(long), 0))