int sizePointerToABC = Marshal.SizeOf(new BluetoothLeServiceDataStruct());
for (int i = 0; i < _serviceListCount; i++)
{
- var svc = (BluetoothLeServiceDataStruct)Marshal.PtrToStructure(new IntPtr(serviceListArray.ToInt32() + (i * sizePointerToABC)), typeof(BluetoothLeServiceDataStruct));
+ var svc = (BluetoothLeServiceDataStruct)Marshal.PtrToStructure(IntPtr.Add(serviceListArray, (i * sizePointerToABC)), typeof(BluetoothLeServiceDataStruct));
list.Add(BluetoothUtils.ConvertStructToLeServiceData(svc));
}