* @brief Returns the index of the port whose system location matches, or -1 when none does. */
| 193 | * @brief Returns the index of the port whose system location matches, or -1 when none does. |
| 194 | */ |
| 195 | static 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. |