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

Function matchPortByLocation

app/src/IO/Drivers/UART.cpp:195–202  ·  view source on GitHub ↗

* @brief Returns the index of the port whose system location matches, or -1 when none does. */

Source from the content-addressed store, hash-verified

193 * @brief Returns the index of the port whose system location matches, or -1 when none does.
194 */
195static int matchPortByLocation(const QVector<QSerialPortInfo>& ports, const QString& location)
196{
197 for (int i = 0; i < ports.count(); ++i)
198 if (ports.at(i).systemLocation() == location)
199 return i;
200
201 return -1;
202}
203
204/**
205 * @brief Opens the currently selected serial port with the specified mode.

Callers 1

openMethod · 0.85

Calls 1

countMethod · 0.45

Tested by

no test coverage detected