ReviewOS

also looking at this

craft-native/craft

iOS: the Bluetooth scan pair — ratchet 35 → 33

#97
Merged glennmichael123 wants to merge feat/ios-bluetooth into main
10 files +679 -3
packages/ios/fixtures/zig-slice/build-and-run.shmodified+13-1
Changes to packages/ios/fixtures/zig-slice/build-and-run.sh
@@ -64,7 +64,7 @@ swiftc -target "$TRIPLE" -sdk "$SDK" \
6464 "$ROOT/packages/zig/zig-out/lib/$LIB" \
6565 -framework UIKit -framework WebKit -framework Foundation -framework Security \
6666 -framework Vision -framework LocalAuthentication -framework PDFKit \
67 -framework WatchConnectivity \
67 -framework WatchConnectivity -framework CoreBluetooth \
6868 -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker "$OUT/sim.entitlements" \
6969 -o "$APP/CraftSlice"
7070
@@ -320,4 +320,16 @@ C54="$(count 54)"
320320[ "$C54" -ge 1 ] || { echo "FAIL: openSettings did not reply with a boolean"; exit 1; }
321321echo "ok: openSettings replied a real boolean, not \"granted\"/\"denied\" (i=54 seen ${C54}x)"
322322
323C56="$(count 56)"
324# The refusal comes from centralManagerDidUpdateState, not from the handler:
325# startBluetoothScan returns having done nothing but create a manager, and the
326# radio answers later. So this passing proves the ticket survived the gap
327# between the call and the callback.
328[ "$C56" -ge 1 ] || { echo "FAIL: startBluetoothScan did not refuse from the state callback"; exit 1; }
329echo "ok: scan refused by the radio's own state, via a deferred ticket (i=56 seen ${C56}x)"
330
331C58="$(count 58)"
332[ "$C58" -ge 1 ] || { echo "FAIL: stopBluetoothScan did not resolve"; exit 1; }
333echo "ok: stopping with nothing running still answers true (i=58 seen ${C58}x)"
334
323335echo "PASS"