feat(apple): mic uplink + touch events in PunktfunkKit
ci / rust (push) Has been cancelled

Adopts the new ABI surface (still v2, additive):

- PunktfunkConnection.sendMic(_:seq:ptsNs:) — Opus mic frames (48 kHz) to the host's
  virtual PipeWire source; enqueue-only, empty data = DTX silence. Wiring the actual
  Mac microphone (AVAudioEngine input → Opus) into the app is the follow-up, alongside
  audio playback (README note 5).
- PunktfunkInputEvent.touchDown/touchMove/touchUp — absolute pixels + surface size in
  flags, host injects via libei ei_touchscreen. Built for the iOS variant; nothing on
  macOS emits them yet.
- Loopback round trip now also sends touch events and mic frames (incl. a DTX frame)
  through the wrapper.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-11 09:08:04 +02:00
parent 6575dddac7
commit 3a51551f97
3 changed files with 52 additions and 2 deletions
@@ -42,10 +42,17 @@ final class LoopbackIntegrationTests: XCTestCase {
}
XCTAssertGreaterThanOrEqual(lastIndex, 24)
// Input goes the other way (enqueue-only; the host logs the count on close).
// Input goes the other way (enqueue-only; the host logs the count on close)
// including the touch kinds and the mic uplink plane (the synthetic host counts
// the datagrams; injection/decoding are Linux-side concerns).
conn.send(.mouseMove(dx: 1, dy: 2))
conn.send(.key(0x41, down: true))
conn.send(.key(0x41, down: false))
conn.send(.touchDown(id: 0, x: 100, y: 200, surfaceWidth: 1280, surfaceHeight: 720))
conn.send(.touchMove(id: 0, x: 110, y: 210, surfaceWidth: 1280, surfaceHeight: 720))
conn.send(.touchUp(id: 0))
conn.sendMic(Data([0xFC, 0xFF, 0xFE]), seq: 0, ptsNs: 1) // tiny opus-ish frame
conn.sendMic(Data(), seq: 1, ptsNs: 2) // DTX silence frame
conn.close()
XCTAssertThrowsError(try conn.nextAU(timeoutMs: 10)) { error in