DRIVE and TUNE_DRIVE are global commands per the TCI v2.0 spec — they have no TRX prefix. Spec form: `drive;` for GET, `drive:N;` for SET. The dispatcher's isSet heuristic (args.size() >= 2) is wrong for globals (treats `drive:50;` as a GET). We override here: any args at all = SET, no args = GET. We also accept the legacy TRX-prefixed form `drive:0,N;` for backward compatibility — when 2+ args ar
| 541 | // for backward compatibility — when 2+ args arrive, we take args[1] as the |
| 542 | // value and ignore the trx index (drive is global anyway). |
| 543 | QString TciProtocol::cmdDrive(const QStringList& args, bool /*isSet*/) |
| 544 | { |
| 545 | if (args.isEmpty()) { |
| 546 | int pwr = m_model ? m_model->transmitModel().rfPower() : 0; |
| 547 | return QStringLiteral("drive:%1;").arg(pwr); |
| 548 | } |
| 549 | bool ok; |
| 550 | int pwr = args[args.size() == 1 ? 0 : 1].toInt(&ok); |
| 551 | if (!ok) return {}; |
| 552 | QMetaObject::invokeMethod(m_model, [model = m_model, pwr]() { |
| 553 | model->transmitModel().setRfPower(pwr); |
| 554 | }, Qt::QueuedConnection); |
| 555 | |
| 556 | m_pendingNotification = QStringLiteral("drive:%1;").arg(pwr); |
| 557 | return {}; |
| 558 | } |
| 559 | |
| 560 | // ── TUNE_DRIVE: get/set tune power ───────────────────────────────────────── |
| 561 |
nothing calls this directly
no test coverage detected