| 280 | // ═════════════════════════════════════════════════════════════════════════════ |
| 281 | |
| 282 | void section1(RigctlClient& c, Runner& r) |
| 283 | { |
| 284 | r.section(QStringLiteral("Section 1 — Connection & Initialization")); |
| 285 | |
| 286 | // 1.2 dump_state |
| 287 | QStringList lines = c.send(QStringLiteral("\\dump_state")); |
| 288 | bool hasDone = std::any_of(lines.cbegin(), lines.cend(), |
| 289 | [](const QString& l){ return l.contains(QLatin1String("done")); }); |
| 290 | r.check(QStringLiteral(R"(1.2 dump_state returns capability block ending with "done")"), |
| 291 | c.ok(lines) && hasDone, |
| 292 | hasDone ? QString() : lines.join(QStringLiteral(" | ")).right(80)); |
| 293 | |
| 294 | // 1.3 get_info (no extended-mode support — use sendRaw) |
| 295 | QStringList raw = c.sendRaw(QStringLiteral("\\get_info"), 1); |
| 296 | r.check(QStringLiteral("1.3 get_info returns a non-empty string"), |
| 297 | !raw.isEmpty() && !raw[0].trimmed().isEmpty(), |
| 298 | raw.isEmpty() ? QStringLiteral("(no response)") : raw[0]); |
| 299 | |
| 300 | // 1.4 get_rig_info |
| 301 | lines = c.send(QStringLiteral("\\get_rig_info")); |
| 302 | const QString info = c.field(lines, QStringLiteral("Info")); |
| 303 | r.check(QStringLiteral("1.4 get_rig_info returns RPRT 0 with Info field"), |
| 304 | c.ok(lines) && !info.isEmpty(), info); |
| 305 | } |
| 306 | |
| 307 | // ═════════════════════════════════════════════════════════════════════════════ |
| 308 | // Section 1b — Hamlib Init Probe Commands (WSJT-X / client compatibility) |