GetDevice returns vendor, product, revision

This commit is contained in:
Uwe Seimet 2021-08-24 10:04:18 +02:00
parent c62912ec7e
commit b44eae0fd5
2 changed files with 6 additions and 3 deletions

View File

@ -121,8 +121,11 @@ public:
unsigned int GetLun() const { return lun; }
void SetLun(unsigned int lun) { this->lun = lun; }
const string GetVendor() const { return vendor; }
void SetVendor(const string&);
const string GetProduct() const { return product; }
void SetProduct(const string&, bool = true);
const string GetRevision() const { return revision; }
void SetRevision(const string&);
const string GetPaddedName() const;

View File

@ -281,11 +281,11 @@ const PbDevices GetDevices()
PbDevice *pbDevice = pbDevices.add_devices();
// Initialize ID and unit number
pbDevice->set_id(i / UnitNum);
pbDevice->set_unit(i % UnitNum);
// ID,UNIT,Type,Device Status
pbDevice->set_vendor(device->GetVendor());
pbDevice->set_product(device->GetProduct());
pbDevice->set_revision(device->GetRevision());
PbDeviceType type = UNDEFINED;
PbDeviceType_Parse(device->GetType(), &type);
pbDevice->set_type(type);