public static VehicleScapeAPI.Result Transfer(uint deviceHandle, bool reflash)
        {
            if (deviceHandle == 0)
            {
                return(VehicleScapeAPI.Result.ResultInvalidHandle);
            }

            int storageMediaCount = 0;

            VehicleScapeAPI.GetStorageMediumsForDevice(deviceHandle, IntPtr.Zero, ref storageMediaCount);
            if (storageMediaCount < 0)
            {
                return(VehicleScapeAPI.Result.ResultInvalidMedium);
            }
            VehicleScapeAPI.MemoryType[] types = new VehicleScapeAPI.MemoryType[storageMediaCount];
            VehicleScapeAPI.GetStorageMediumsForDevice(deviceHandle, types, ref storageMediaCount);
            VehicleScapeAPI.Result result = VehicleScapeAPI.Result.ResultOk;
            if (reflash)
            {
                VehicleScapeAPI.ReflashDevice(deviceHandle);
            }
            if (result != VehicleScapeAPI.Result.ResultOk)
            {
                return(result);
            }
            return(VehicleScapeAPI.SendCoreMini(deviceHandle, types[0], VehicleScapeAPI.RUNCOREMINI | VehicleScapeAPI.SYNCRTC));
        }