MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / section7

Function section7

tests/CAT_Flex_test.cpp:544–595  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

542// ═════════════════════════════════════════════════════════════════════════════
543
544void section7(CatClient& c, Runner& r)
545{
546 r.section(QStringLiteral("Section 7 — ZZAI — AI Mode (async unsolicited updates)"));
547
548 QString resp = c.query(QStringLiteral("ZZAI"));
549 r.check(QStringLiteral("7.1 ZZAI; → ZZAI00 (disabled by default)"),
550 resp == QLatin1String("ZZAI00"), repr(resp));
551
552 QString aiResp = c.query(QStringLiteral("AI"));
553 r.check(QStringLiteral("7.2 AI; and ZZAI; share the same state (both report disabled)"),
554 aiResp == QLatin1String("AI0"), repr(aiResp));
555
556 c.send(QStringLiteral("ZZAI01"));
557 resp = c.query(QStringLiteral("ZZAI"));
558 r.check(QStringLiteral("7.3 ZZAI01; enables AI; ZZAI; → ZZAI01"),
559 resp == QLatin1String("ZZAI01"), repr(resp));
560 aiResp = c.query(QStringLiteral("AI"));
561 r.check(QStringLiteral("7.4 AI; reflects ZZAI enable (shared state)"),
562 aiResp == QLatin1String("AI1"), repr(aiResp));
563
564 const qint64 newHz = 14'100'000;
565 c.send(QStringLiteral("ZZFA") + hz11(newHz));
566 QString push = c.tryRead(2000);
567 r.check(QStringLiteral("7.5 AI push after ZZFA set → push is \"FA<freq>\" (NOT ZZFA prefix)"),
568 push == QStringLiteral("FA") + hz11(newHz), repr(push));
569
570 c.send(QStringLiteral("ZZMD05")); // FM
571 push = c.tryRead(2000);
572 r.check(QStringLiteral("7.6 AI push after ZZMD set → push is \"MD4\" (FM, NOT ZZMD prefix)"),
573 push == QLatin1String("MD4"), repr(push));
574
575 c.send(QStringLiteral("ZZAI00"));
576 resp = c.query(QStringLiteral("ZZAI"));
577 r.check(QStringLiteral("7.7 ZZAI00; disables AI; ZZAI; → ZZAI00"),
578 resp == QLatin1String("ZZAI00"), repr(resp));
579
580 c.send(QStringLiteral("ZZFA") + hz11(14'225'000));
581 QString silence = c.tryRead(500);
582 r.check(QStringLiteral("7.8 no AI push after ZZAI00 (silence expected)"),
583 silence.isNull(),
584 QStringLiteral("got unexpected push: %1").arg(repr(silence)));
585
586 c.send(QStringLiteral("AI1"));
587 resp = c.query(QStringLiteral("ZZAI"));
588 r.check(QStringLiteral("7.9 enable via base AI1; → ZZAI; → ZZAI01"),
589 resp == QLatin1String("ZZAI01"), repr(resp));
590
591 c.send(QStringLiteral("AI0"));
592 resp = c.query(QStringLiteral("ZZAI"));
593 r.check(QStringLiteral("7.10 disable via base AI0; → ZZAI; → ZZAI00"),
594 resp == QLatin1String("ZZAI00"), repr(resp));
595}
596
597// ═════════════════════════════════════════════════════════════════════════════
598// Section 8 — ZZSW — Split

Callers 1

mainFunction · 0.70

Calls 8

isNullMethod · 0.80
reprFunction · 0.70
hz11Function · 0.70
sectionMethod · 0.45
queryMethod · 0.45
checkMethod · 0.45
sendMethod · 0.45
tryReadMethod · 0.45

Tested by

no test coverage detected