MCPcopy Create free account
hub / github.com/GENIVI/CANdevStudio / startSimulation

Method startSimulation

src/components/candevice/candevice.cpp:149–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149void CanDevice::startSimulation()
150{
151 Q_D(CanDevice);
152
153 d->_simStarted = true;
154
155 if (!d->_initialized) {
156 cds_info("CanDevice not initialized");
157 return;
158 }
159
160 if (!d->_canDevice.connectDevice()) {
161 cds_error("Failed to connect device. Trying to init the device again...");
162
163 // Cannelloni plugin fails to reconnect after initial disconnection.
164 // This workaround reinit the device before reconnection
165 // TODO: Findout why cannelloni plugin fails.
166 if (init()) {
167 cds_info("Re-init successful");
168
169 if (!d->_canDevice.connectDevice()) {
170 cds_error("Failed to re-connect device");
171 } else {
172 cds_info("Re-connection successful");
173 }
174 }
175 }
176
177 d->_sendQueue.clear();
178}
179
180void CanDevice::stopSimulation()
181{

Callers 1

candevice_test.cppFile · 0.45

Calls 2

connectDeviceMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected