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/zig/src/ios_delegate.zigmodified+8-0
Changes to packages/zig/src/ios_delegate.zig
@@ -50,6 +50,13 @@ pub const enc = struct {
5050 /// did-finish-picking pair and `userContentController:didReceiveScriptMessage:`
5151 /// are both this shape.
5252 pub const void_two_objects: [:0]const u8 = "v@:@@";
53 /// `- (void)m:(id)a :(id)b :(id)c :(id)d` — four object arguments.
54 /// `centralManager:didDiscoverPeripheral:advertisementData:RSSI:` is this
55 /// shape, and it is the widest one any delegate here uses. `RSSI:` is an
56 /// `NSNumber *`, not a primitive, so it counts as an object like the rest —
57 /// getting that wrong would read the signal strength from the wrong
58 /// register and report a plausible number.
59 pub const void_four_objects: [:0]const u8 = "v@:@@@@";
5360 /// `- (BOOL)m:(id)a :(id)b` — `application:didFinishLaunchingWithOptions:`.
5461 ///
5562 /// `B` is C99 `_Bool`: on 64-bit Apple platforms `__OBJC_BOOL_IS_BOOL` is
@@ -189,5 +196,6 @@ test "the encodings name the shapes these delegates actually use" {
189196 // them is the only defence available, so the names are pinned.
190197 try testing.expectEqualStrings("v@:@", enc.void_one_object);
191198 try testing.expectEqualStrings("v@:@@", enc.void_two_objects);
199 try testing.expectEqualStrings("v@:@@@@", enc.void_four_objects);
192200 try testing.expectEqualStrings("B@:@@", enc.bool_two_objects);
193201}