1

Topic: Program hanging the second time

The plugin works great but the second time it hangs.
Do I need to close the device? Is there a way to close the connection?

Thanks!!

Here is the code:

DeviceList list = DeviceList.Local;

        hidDevice = list.GetHidDeviceOrNull(VendorId, ProductId);
        if(hidDevice != null)
        {
            Debug.Log(hidDevice.GetFriendlyName());
            DeviceStream deviceStream;
            if (hidDevice.TryOpen(out deviceStream))
            {
                deviceStream.WriteTimeout = 1000;
                deviceStream.Write(mStartData, 0, mStartData.Length);
                deviceStream.Close();
            }
        }