mirror of
https://github.com/akuker/RASCSI.git
synced 2025-02-23 06:28:59 +00:00
PbDevice returns information on whether a device is removable (#167)
* PbDevice returns information on whether a device is removable * Fixed log message
This commit is contained in:
parent
eeef537bc0
commit
1ba3b6a2f6
@ -950,7 +950,7 @@ void Disk::GetPath(Filepath& path) const
|
||||
// Flush
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
BOOL Disk::Flush()
|
||||
bool Disk::Flush()
|
||||
{
|
||||
// Do nothing if there's nothing cached
|
||||
if (!disk.dcache) {
|
||||
|
@ -201,14 +201,14 @@ public:
|
||||
virtual BOOL Open(const Filepath& path, BOOL attn = TRUE); // Open
|
||||
void GetPath(Filepath& path) const; // Get the path
|
||||
void Eject(BOOL force); // Eject
|
||||
BOOL IsReady() const { return disk.ready; } // Ready check
|
||||
bool IsReady() const { return disk.ready; } // Ready check
|
||||
void WriteP(BOOL flag); // Set Write Protect flag
|
||||
BOOL IsWriteP() const { return disk.writep; } // Get write protect flag
|
||||
BOOL IsReadOnly() const { return disk.readonly; } // Get read only flag
|
||||
BOOL IsRemovable() const { return disk.removable; } // Get is removable flag
|
||||
BOOL IsLocked() const { return disk.lock; } // Get locked status
|
||||
BOOL IsAttn() const { return disk.attn; } // Get attention flag
|
||||
BOOL Flush(); // Flush the cache
|
||||
bool IsWriteP() const { return disk.writep; } // Get write protect flag
|
||||
bool IsReadOnly() const { return disk.readonly; } // Get read only flag
|
||||
bool IsRemovable() const { return disk.removable; } // Get is removable flag
|
||||
bool IsLocked() const { return disk.lock; } // Get locked status
|
||||
bool IsAttn() const { return disk.attn; } // Get attention flag
|
||||
bool Flush(); // Flush the cache
|
||||
|
||||
// Properties
|
||||
void SetLUN(DWORD lun) { disk.lun = lun; } // LUN set
|
||||
|
@ -291,6 +291,8 @@ PbDevices GetDevices() {
|
||||
device->set_file(pUnit->IsRemovable() && !pUnit->IsReady() ? "NO MEDIA" : filepath.GetPath());
|
||||
}
|
||||
|
||||
device->set_removable(pUnit->IsRemovable());
|
||||
|
||||
// Write protection status
|
||||
if (pUnit->IsRemovable() && pUnit->IsReady() && pUnit->IsWriteP()) {
|
||||
device->set_read_only(true);
|
||||
@ -686,7 +688,7 @@ bool ProcessCmd(int fd, const PbCommand &command)
|
||||
break;
|
||||
|
||||
case EJECT:
|
||||
LOGINFO("rasctl commands eject %s ID: %d UN: %d", type_str, id, un);
|
||||
LOGINFO("rasctl commanded eject for %s ID: %d UN: %d", pUnit->GetID().c_str(), id, un);
|
||||
pUnit->Eject(TRUE);
|
||||
break;
|
||||
|
||||
|
@ -48,7 +48,8 @@ message PbDevice {
|
||||
int32 un = 2;
|
||||
string type = 3;
|
||||
string file = 4;
|
||||
bool read_only = 5;
|
||||
bool removable = 5;
|
||||
bool read_only = 6;
|
||||
}
|
||||
|
||||
message PbDevices {
|
||||
|
Loading…
x
Reference in New Issue
Block a user