From 227c8a4a092f7896f298fa90630bc4b1ccdec230 Mon Sep 17 00:00:00 2001 From: Oystein Tveit Date: Tue, 29 Aug 2023 16:29:49 +0200 Subject: [PATCH] Add other enums --- src/{commands.rs => command.rs} | 0 src/device.rs | 15 +++++++++++++++ src/lib.rs | 5 ++++- src/sense_key.rs | 17 +++++++++++++++++ src/status.rs | 10 ++++++++++ 5 files changed, 46 insertions(+), 1 deletion(-) rename src/{commands.rs => command.rs} (100%) create mode 100644 src/device.rs create mode 100644 src/sense_key.rs create mode 100644 src/status.rs diff --git a/src/commands.rs b/src/command.rs similarity index 100% rename from src/commands.rs rename to src/command.rs diff --git a/src/device.rs b/src/device.rs new file mode 100644 index 0000000..115bab4 --- /dev/null +++ b/src/device.rs @@ -0,0 +1,15 @@ +pub enum Device { + DirectAccessDevice, // (SBC-4) + ZonedBlockDevice, // (ZBC) + SequentialAccessDevice, // (SSC-5) + ProcessorDevice, // (SPC-2) + CDDVDDevice, // (MMC-6) + OpticalMemoryDevice, // (SBC) + MediaChangerDevice, // (SMC-3) + StorageArrayDevice, // (SCC-2) + EnclosureServicesDevice, // (SES-3) + SimplifiedDirectAccessDevice, // (RBC) + OpticalCardReaderWriterDevice, // (OCRW) + AutomationDriveInterfaceDevice, // (ADC-4) + ObjectBasedStorageDevice, // (OSD-2) +} diff --git a/src/lib.rs b/src/lib.rs index 4dd391f..0f812f7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,6 @@ #![no_std] -pub mod commands; \ No newline at end of file +pub mod command; +pub mod device; +pub mod status; +pub mod sense_key; diff --git a/src/sense_key.rs b/src/sense_key.rs new file mode 100644 index 0000000..ee7808f --- /dev/null +++ b/src/sense_key.rs @@ -0,0 +1,17 @@ +pub enum SenseKey { + NoSense = 0x00, + RecoveredError = 0x01, + NotReady = 0x02, + MediumError = 0x03, + HardwareError = 0x04, + IllegalRequest = 0x05, + UnitAttention = 0x06, + DataProtect = 0x07, + BlankCheck = 0x08, + VendorSpecific = 0x09, + CopyAborted = 0x0A, + AbortedCommand = 0x0B, + VolumeOverflow = 0x0D, + Miscompare = 0x0E, + Completed = 0x0F, +} \ No newline at end of file diff --git a/src/status.rs b/src/status.rs new file mode 100644 index 0000000..1f515c5 --- /dev/null +++ b/src/status.rs @@ -0,0 +1,10 @@ +pub enum Status { + Good = 0x00, + CheckCondition = 0x02, + ConditionMet = 0x04, + Busy = 0x08, + ReservationConflict = 0x18, + TaskSetFull = 0x28, + AcaActive = 0x30, + TaskAborted = 0x40, +} \ No newline at end of file