Skip to content

v1.1.1 — Yaesu PTT-on-connect fix

Choose a tag to compare

@jjones9527 jjones9527 released this 10 Jul 22:12

Patch release fixing a safety-critical bug that keyed Yaesu radios into transmit on connect.

Full detail in issue #11 and the CHANGELOG entry.

Fixed

  • IOKitSerialPort.open() now de-asserts DTR and RTS after configuring termios. macOS opens serial ttys with DTR asserted by default, and CP210x / FTDI drivers leave RTS in its power-on state. Yaesu HF radios (FT-DX10, FT-DX101, FT-991A, FT-891, FT-450D, FT-950, FT-2000, FT-DX3000/5000, and many earlier models) drive hardware PTT off one of these lines on their CAT USB port — so simply opening the port keyed the radio into TX and held it there until the USB cable was physically unplugged.
    Clearing CRTSCTS in termios only disables flow-control use of the pins; the fix uses ioctl(TIOCMBIC, TIOCM_DTR | TIOCM_RTS) to actually drive them low.
    RTS is preserved when hardwareFlowControl is true, so hardware-flow-controlled devices continue to work.
    Safety and regulatory concern under FCC §97.213 and equivalent regimes worldwide — a CAT library that keys on connect is not fit to ship. Reported by a downstream MacWinlink user on a Yaesu FT-DX10 with a Silicon Labs CP2105 USB-UART.

Added

  • SerialTransport.setDTR(_:) / setRTS(_:) — public API to drive the DTR and RTS modem control lines from the transport layer. Since open() now de-asserts both lines, callers whose device legitimately needs DTR or RTS asserted (some GPS pucks, Kenwood TS-590 with DTR-as-PTT configured, external TNCs) can opt in explicitly. IOKitSerialPort implements via TIOCMBIS / TIOCMBIC; TCPSerialTransport is a documented no-op; MockSerialTransport records calls as recordedDTR / recordedRTS for test assertions.

Compatibility

No API breakage. The two setDTR / setRTS methods are additive on the SerialTransport protocol with default no-op implementations, so downstream conformers don't need to update.

Regression coverage

  • New IOKitSerialPortModemLineTests opens an openpty(3) pair, has IOKitSerialPort open the slave, and reads the master's modem-line state via TIOCMGET. Asserts both DTR and RTS are low after open(). Regression guard for issue #11.
  • MockSerialTransportTests gained coverage for the new setDTR / setRTS recording and reset behavior.

Test status: 459 tests, 0 failures.

Consumer update

The MacWinlink app has already bumped its SPM pin to 1.1.1 (ARSFI/MacWinlink@3a12adc) and shipped beta21 with the fix. Other SwiftRigControl consumers should bump when convenient — the fix is safety-relevant for any macOS app driving a Yaesu radio over CAT USB.