diff --git a/runtime/bindings-generator.cs b/runtime/bindings-generator.cs index 81b3496d31ef..fdc3327d2231 100644 --- a/runtime/bindings-generator.cs +++ b/runtime/bindings-generator.cs @@ -95,6 +95,15 @@ static IEnumerable GetFunctionData () } ); + data.Add ( + new FunctionData { + Comment = " // NVector3d func ()", + Prefix = "simd__", + Variants = Variants.All, + ReturnType = Types.NVector3d, + } + ); + data.Add ( new FunctionData { Comment = " // void func (NVector3)", diff --git a/src/nearbyinteraction.cs b/src/nearbyinteraction.cs index d6b0008f3e21..15b06a5c6c42 100644 --- a/src/nearbyinteraction.cs +++ b/src/nearbyinteraction.cs @@ -10,6 +10,7 @@ using ObjCRuntime; using Foundation; using CoreFoundation; +using CoreGraphics; using System; using System.Numerics; #if __MACCATALYST__ || !IOS @@ -173,6 +174,10 @@ interface NISessionDelegate { [NoTV, NoMac, iOS (16, 0), MacCatalyst (16, 0)] [Export ("sessionDidStartRunning:")] void DidSessionStartRunning (NISession session); + + [NoTV, NoMacCatalyst, NoMac, iOS (26, 0)] + [Export ("session:didUpdateDLTDOAMeasurements:")] + void DidUpdateDlTdoaMeasurements (NISession session, NIDlTdoaMeasurement [] measurements); } [NoTV, NoMac, iOS (15, 0), MacCatalyst (15, 0)] @@ -230,6 +235,11 @@ interface NIDeviceCapability { [Abstract (GenerateExtensionMethod = true)] [Export ("supportsExtendedDistanceMeasurement")] bool SupportsExtendedDistanceMeasurement { get; } + + [NoTV, NoMacCatalyst, NoMac, iOS (26, 0)] + [Abstract] + [Export ("supportsDLTDOAMeasurement")] + bool SupportsDlTdoaMeasurement { get; } } [NoTV, NoMac, iOS (16, 0), MacCatalyst (16, 0)] @@ -242,4 +252,69 @@ interface NIAlgorithmConvergence : NSCopying, NSSecureCoding { [Export ("reasons")] string [] Reasons { get; } } + + [NoTV, NoMacCatalyst, NoMac, iOS (26, 0)] + [BaseType (typeof (NIConfiguration), Name = "NIDLTDOAConfiguration")] + [DisableDefaultCtor] + // DLTDOA = Down Link Time Difference of Arrival(DL-TDoA) + interface NIDlTdoaConfiguration { + [Export ("networkIdentifier")] + nint NetworkIdentifier { get; set; } + + [Export ("initWithNetworkIdentifier:")] + NativeHandle Constructor (nint networkIdentifier); + } + + [NoTV, NoMacCatalyst, NoMac, iOS (26, 0)] + [Native] + [NativeName ("NIDLTDOACoordinatesType")] + // DLTDOA = Down Link Time Difference of Arrival(DL-TDoA) + public enum NIDlTdoaCoordinatesType : long { + Geodetic = 0, + Relative = 1, + } + + [NoTV, NoMacCatalyst, NoMac, iOS (26, 0)] + [Native] + [NativeName ("NIDLTDOAMeasurementType")] + // DLTDOA = Down Link Time Difference of Arrival(DL-TDoA) + public enum NIDlTdoaMeasurementType : long { + Poll = 0, + Response = 1, + Final = 2, + } + + [NoTV, NoMacCatalyst, NoMac, iOS (26, 0)] + [BaseType (typeof (NSObject), Name = "NIDLTDOAMeasurement")] + [DisableDefaultCtor] + // DLTDOA = Down Link Time Difference of Arrival(DL-TDoA) + interface NIDlTdoaMeasurement : NSCopying, NSSecureCoding { + [Export ("address")] + nuint Address { get; } + + [Export ("measurementType", ArgumentSemantic.Assign)] + NIDlTdoaMeasurementType MeasurementType { get; } + + [Export ("transmitTime")] + double TransmitTime { get; } + + [Export ("receiveTime")] + double ReceiveTime { get; } + + [Export ("signalStrength")] + double SignalStrength { get; } + + [Export ("carrierFrequencyOffset")] + double CarrierFrequencyOffset { get; } + + [Export ("coordinatesType", ArgumentSemantic.Assign)] + NIDlTdoaCoordinatesType CoordinatesType { get; } + + [Export ("coordinates", ArgumentSemantic.Assign)] + NVector3d Coordinates { + [MarshalDirective (NativePrefix = "xamarin_simd__", Library = "__Internal")] + get; + } + } + } diff --git a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-NearbyInteraction.ignore b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-NearbyInteraction.ignore index c8f4b53a3927..2fa8bab27b54 100644 --- a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-NearbyInteraction.ignore +++ b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-NearbyInteraction.ignore @@ -1,2 +1,5 @@ # This selector requires ARKit, which doesn't work on Mac Catalyst !missing-selector! NISession::setARSession: not bound +# Headers are clear that these two enums are not supported on Mac Catalyst, don't know why xtro thinks they are +!missing-enum! NIDLTDOACoordinatesType not bound +!missing-enum! NIDLTDOAMeasurementType not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-NearbyInteraction.todo b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-NearbyInteraction.todo deleted file mode 100644 index e8e77a2ab3d1..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-NearbyInteraction.todo +++ /dev/null @@ -1,2 +0,0 @@ -!missing-enum! NIDLTDOACoordinatesType not bound -!missing-enum! NIDLTDOAMeasurementType not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/iOS-NearbyInteraction.todo b/tests/xtro-sharpie/api-annotations-dotnet/iOS-NearbyInteraction.todo deleted file mode 100644 index 13f8dec766ac..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/iOS-NearbyInteraction.todo +++ /dev/null @@ -1,18 +0,0 @@ -!missing-enum! NIDLTDOACoordinatesType not bound -!missing-enum! NIDLTDOAMeasurementType not bound -!missing-protocol-member! NIDeviceCapability::supportsDLTDOAMeasurement not found -!missing-protocol-member! NISessionDelegate::session:didUpdateDLTDOAMeasurements: not found -!missing-selector! NIDLTDOAConfiguration::initWithNetworkIdentifier: not bound -!missing-selector! NIDLTDOAConfiguration::networkIdentifier not bound -!missing-selector! NIDLTDOAConfiguration::setNetworkIdentifier: not bound -!missing-selector! NIDLTDOAMeasurement::address not bound -!missing-selector! NIDLTDOAMeasurement::carrierFrequencyOffset not bound -!missing-selector! NIDLTDOAMeasurement::coordinates not bound -!missing-selector! NIDLTDOAMeasurement::coordinatesType not bound -!missing-selector! NIDLTDOAMeasurement::measurementType not bound -!missing-selector! NIDLTDOAMeasurement::receiveTime not bound -!missing-selector! NIDLTDOAMeasurement::signalStrength not bound -!missing-selector! NIDLTDOAMeasurement::transmitTime not bound -!missing-type! NIDLTDOAConfiguration not bound -!missing-type! NIDLTDOAMeasurement not bound -!unknown-simd-type-mapping! The Simd type simd_double3 does not have a mapping to a managed type. Please add one in SimdCheck.cs diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-NearbyInteraction.ignore b/tests/xtro-sharpie/api-annotations-dotnet/macOS-NearbyInteraction.ignore new file mode 100644 index 000000000000..7a7ba1b0dd3a --- /dev/null +++ b/tests/xtro-sharpie/api-annotations-dotnet/macOS-NearbyInteraction.ignore @@ -0,0 +1,3 @@ +# Headers are clear that these two enums are not supported on macOS, don't know why xtro thinks they are +!missing-enum! NIDLTDOACoordinatesType not bound +!missing-enum! NIDLTDOAMeasurementType not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-NearbyInteraction.todo b/tests/xtro-sharpie/api-annotations-dotnet/macOS-NearbyInteraction.todo deleted file mode 100644 index e8e77a2ab3d1..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-NearbyInteraction.todo +++ /dev/null @@ -1,2 +0,0 @@ -!missing-enum! NIDLTDOACoordinatesType not bound -!missing-enum! NIDLTDOAMeasurementType not bound diff --git a/tests/xtro-sharpie/xtro-sharpie/SimdCheck.cs b/tests/xtro-sharpie/xtro-sharpie/SimdCheck.cs index e15fdb46c525..000a28b84c46 100644 --- a/tests/xtro-sharpie/xtro-sharpie/SimdCheck.cs +++ b/tests/xtro-sharpie/xtro-sharpie/SimdCheck.cs @@ -42,6 +42,7 @@ class NativeSimdInfo { { "vector_uint4", new NativeSimdInfo { Managed = "Vector4i", }}, // simd_doubleX is typedefed to vector_doubleX { "simd_double2", new NativeSimdInfo { Managed = "Vector2d" }}, + { "simd_double3", new NativeSimdInfo { Managed = "NVector3d" }}, // simd_floatX is typedefed to vector_floatX { "simd_float2", new NativeSimdInfo { Managed = "Vector2" }}, { "simd_float3", new NativeSimdInfo { Managed = "Vector3" }},