Set block size in device info

This commit is contained in:
Uwe Seimet 2021-08-24 12:17:55 +02:00
parent 4c0ff2b421
commit d5a2f230fd

View File

@ -298,6 +298,30 @@ const PbDevices GetDevices()
pbDevice->set_lockable(device->IsLockable());
pbDevice->set_locked(device->IsLocked());
const Disk *disk = dynamic_cast<Disk*>(device);
if (disk) {
switch (disk->GetSectorSize()) {
case 9:
pbDevice->set_block_size(512);
break;
case 10:
pbDevice->set_block_size(1024);
break;
case 11:
pbDevice->set_block_size(2048);
break;
case 12:
pbDevice->set_block_size(4096);
break;
default:
break;
}
}
const FileSupport *fileSupport = dynamic_cast<FileSupport *>(device);
if (fileSupport) {
Filepath filepath;