[hal] Add handle constructor and name getters for sim devices (#4925)

This commit is contained in:
Ryan Blue
2023-01-11 14:45:15 -05:00
committed by GitHub
parent 53d8d33bca
commit dc4355c031
11 changed files with 98 additions and 1 deletions

View File

@@ -27,6 +27,12 @@ SimDeviceSim::SimDeviceSim(const char* name, int index, int channel) {
fmt::format("{}[{},{}]", name, index, channel).c_str());
}
SimDeviceSim::SimDeviceSim(HAL_SimDeviceHandle handle) : m_handle(handle) {}
std::string SimDeviceSim::GetName() const {
return std::string(HALSIM_GetSimDeviceName(m_handle));
}
hal::SimValue SimDeviceSim::GetValue(const char* name) const {
return HALSIM_GetSimValueHandle(m_handle, name);
}