From 2e1855c6c3009103b2718806d5e6c909525c3613 Mon Sep 17 00:00:00 2001 From: teach310 Date: Tue, 21 Nov 2023 18:56:04 +0900 Subject: [PATCH 1/2] remove redunadnt Marshal attribute MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit byte[] は Blittable なため MarshalAs アトリビュートは不要 そしてIn, Out アトリビュートもマーシャリング用なため不要 https://learn.microsoft.com/ja-jp/dotnet/api/system.runtime.interopservices.outattribute?view=net-8.0 --- .../Runtime/NativeMethods.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Packages/com.teach310.core-bluetooth-for-unity/Runtime/NativeMethods.cs b/Packages/com.teach310.core-bluetooth-for-unity/Runtime/NativeMethods.cs index ad824ad..59c679d 100644 --- a/Packages/com.teach310.core-bluetooth-for-unity/Runtime/NativeMethods.cs +++ b/Packages/com.teach310.core-bluetooth-for-unity/Runtime/NativeMethods.cs @@ -246,7 +246,7 @@ int subscribedCentralsCount internal static extern SafeNativeMutableCharacteristicHandle cb4u_mutable_characteristic_new( [MarshalAs(UnmanagedType.LPStr), In] string uuid, int properties, - [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 3)] byte[] dataBytes, + byte[] dataBytes, int dataLength, int permissions ); @@ -258,7 +258,7 @@ int permissions internal static extern int cb4u_mutable_characteristic_value(SafeNativeMutableCharacteristicHandle handle, byte[] dataBytes, int dataLength); [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] - internal static extern void cb4u_mutable_characteristic_set_value(SafeNativeMutableCharacteristicHandle handle, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 2), In] byte[] dataBytes, int dataLength); + internal static extern void cb4u_mutable_characteristic_set_value(SafeNativeMutableCharacteristicHandle handle, byte[] dataBytes, int dataLength); [DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)] internal static extern int cb4u_mutable_characteristic_properties(SafeNativeMutableCharacteristicHandle handle); From ec05b255389a149ae48329897b27127d91a8f3a7 Mon Sep 17 00:00:00 2001 From: teach310 Date: Tue, 21 Nov 2023 19:01:26 +0900 Subject: [PATCH 2/2] update package version --- Packages/com.teach310.core-bluetooth-for-unity/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages/com.teach310.core-bluetooth-for-unity/package.json b/Packages/com.teach310.core-bluetooth-for-unity/package.json index ca403fa..8033b61 100644 --- a/Packages/com.teach310.core-bluetooth-for-unity/package.json +++ b/Packages/com.teach310.core-bluetooth-for-unity/package.json @@ -1,6 +1,6 @@ { "name": "com.teach310.core-bluetooth-for-unity", - "version": "0.4.4", + "version": "0.4.5", "displayName": "CoreBluetooth", "description": "Provides native Apple CoreBluetooth integration for use with Unity.", "unity": "2022.3",