std::string LoadedDeviceAdapter::GetDeviceDescription(const std::string& deviceName) const { ModuleStringBuffer descBuf(this, "GetDeviceDescription"); bool ok = GetDeviceDescription(deviceName.c_str(), descBuf.GetBuffer(), descBuf.GetMaxStrLen()); if (!ok) { throw CMMError("Cannot get description for device " + ToQuotedString(deviceName) + " of device adapter module " + ToQuotedString(name_)); } return descBuf.Get(); }
std::string HubInstance::GetInstalledPeripheralDescription(const std::string& peripheralName) { std::vector<MM::Device*> peripherals = GetInstalledPeripherals(); for (std::vector<MM::Device*>::iterator it = peripherals.begin(), end = peripherals.end(); it != end; ++it) { DeviceStringBuffer nameBuf(0, "GetName"); (*it)->GetName(nameBuf.GetBuffer()); if (nameBuf.Get() == peripheralName) { DeviceStringBuffer descBuf(0, "GetDescription"); (*it)->GetDescription(descBuf.GetBuffer()); return descBuf.Get(); } } throw CMMError("No peripheral with name " + ToQuotedString(peripheralName) + " installed in hub " + ToQuotedString(GetLabel())); }