MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / connectDevice

Method connectDevice

app/src/IO/ConnectionManager.cpp:677–703  ·  view source on GitHub ↗

* @brief Connects the primary device (device 0) and, in ProjectFile mode, all other sources. */

Source from the content-addressed store, hash-verified

675 * @brief Connects the primary device (device 0) and, in ProjectFile mode, all other sources.
676 */
677void IO::ConnectionManager::connectDevice()
678{
679#ifdef BUILD_COMMERCIAL
680 if ((Licensing::Trial::instance().trialExpired()
681 && !Licensing::CommercialToken::current().isValid())
682 || !SS_LICENSE_GUARD()) {
683 disconnectDevice();
684 Misc::Utilities::showMessageBox(
685 tr("Your trial period has ended."),
686 tr("To continue using Serial Studio, please activate your license."));
687 return;
688 }
689#endif
690
691 if (AppState::instance().operationMode() == SerialStudio::ProjectFile)
692 DataModel::ControlScript::instance().runOnConnect();
693
694 QApplication::setOverrideCursor(Qt::WaitCursor);
695
696 connectDevice(0);
697
698 if (AppState::instance().operationMode() == SerialStudio::ProjectFile)
699 connectAllDevices();
700
701 QApplication::restoreOverrideCursor();
702 Q_EMIT connectedChanged();
703}
704
705/**
706 * @brief Disconnects the primary device and any other project sources.

Callers 12

refreshSerialDevicesMethod · 0.80
connectWithRetryMethod · 0.80
openMethod · 0.80
connectMethod · 0.80
setupUartConnectionMethod · 0.80
setupTcpConnectionMethod · 0.80
setupUdpConnectionMethod · 0.80
setupCanbusConnectionMethod · 0.80
startDemoMethod · 0.80

Calls 6

trialExpiredMethod · 0.80
operationModeMethod · 0.80
runOnConnectMethod · 0.80
findMethod · 0.80
isValidMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected