htc: implement mux side of connecting (and more)

This commit is contained in:
Michael Scire authored and SciresM committed 2021-02-24 04:06:54 -08:00
1 parent 70aae4e27a
commit 42cf3f50d7
24 files changed
+474 -12

No files matched your search

@@ -55,6 +55,20 @@ namespace ams::htclow::driver {
return ResultSuccess();
}
void DriverManager::CloseDriver() {
/* Lock ourselves. */
std::scoped_lock lk(m_mutex);
/* Clear our driver type. */
m_driver_type = std::nullopt;
/* Close our driver. */
if (m_open_driver != nullptr) {
m_open_driver->Close();
m_open_driver = nullptr;
}
}
impl::DriverType DriverManager::GetDriverType() {
/* Lock ourselves. */
std::scoped_lock lk(m_mutex);
@@ -69,6 +83,10 @@ namespace ams::htclow::driver {
return m_open_driver;
}
void DriverManager::Cancel() {
m_open_driver->CancelSendReceive();
}
void DriverManager::SetDebugDriver(IDriver *driver) {
m_debug_driver = driver;
m_driver_type = impl::DriverType::Debug;