mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Device: Add logical disk size accessor
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#ifndef __LOGICALDISKINFOMESSAGE_H_
|
||||
#define __LOGICALDISKINFOMESSAGE_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/communication/message/message.h"
|
||||
#include <cstdint>
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class LogicalDiskInfoMessage : public Message {
|
||||
public:
|
||||
LogicalDiskInfoMessage(bool isConnected, uint32_t numSectors, uint32_t numHidden, uint32_t sectorSize) :
|
||||
Message(Message::Type::LogicalDiskInfo), connected(isConnected), sectors(numSectors),
|
||||
hiddenSectors(numHidden), bytesPerSector(sectorSize) {}
|
||||
|
||||
const bool connected;
|
||||
const uint32_t sectors;
|
||||
const uint32_t hiddenSectors;
|
||||
const uint32_t bytesPerSector;
|
||||
|
||||
uint64_t getReportedSize() const { return uint64_t(sectors) * bytesPerSector; }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif
|
||||
@@ -27,6 +27,7 @@ public:
|
||||
Main51 = 0x8005,
|
||||
FlexRayControl = 0x8006,
|
||||
EthernetPhyRegister = 0x8007,
|
||||
LogicalDiskInfo = 0x8008,
|
||||
};
|
||||
|
||||
Message(Type t) : type(t) {}
|
||||
|
||||
Reference in New Issue
Block a user