* @brief Returns true when at least one device is currently connected. */
| 178 | * @brief Returns true when at least one device is currently connected. |
| 179 | */ |
| 180 | bool IO::ConnectionManager::isConnected() const |
| 181 | { |
| 182 | if (AppState::instance().operationMode() == SerialStudio::ProjectFile) { |
| 183 | for (const auto& [id, dm] : m_devices) |
| 184 | if (dm && dm->isOpen()) |
| 185 | return true; |
| 186 | |
| 187 | return false; |
| 188 | } |
| 189 | |
| 190 | auto it = m_devices.find(0); |
| 191 | return it != m_devices.end() && it->second && it->second->isOpen(); |
| 192 | } |
| 193 | |
| 194 | /** |
| 195 | * @brief Returns whether the device with the given source ID is currently open. |
no test coverage detected