<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[James's Programming Page — Program hanging the second time]]></title>
	<link rel="self" href="https://swforum.seekye.com/feed/atom/topic/10106/" />
	<updated>2018-09-12T21:04:44Z</updated>
	<generator>PunBB</generator>
	<id>https://swforum.seekye.com/topic/10106/</id>
		<entry>
			<title type="html"><![CDATA[Program hanging the second time]]></title>
			<link rel="alternate" href="https://swforum.seekye.com/post/12996/#p12996" />
			<content type="html"><![CDATA[<p>The plugin works great but the second time it hangs.<br />Do I need to close the device? Is there a way to close the connection?</p><p>Thanks!!</p><p>Here is the code:</p><p>DeviceList list = DeviceList.Local;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; hidDevice = list.GetHidDeviceOrNull(VendorId, ProductId);<br />&nbsp; &nbsp; &nbsp; &nbsp; if(hidDevice != null)<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Debug.Log(hidDevice.GetFriendlyName());<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DeviceStream deviceStream;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (hidDevice.TryOpen(out deviceStream))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; deviceStream.WriteTimeout = 1000;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; deviceStream.Write(mStartData, 0, mStartData.Length);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; deviceStream.Close();<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; }</p>]]></content>
			<author>
				<name><![CDATA[macy]]></name>
				<uri>https://swforum.seekye.com/user/14227/</uri>
			</author>
			<updated>2018-09-12T21:04:44Z</updated>
			<id>https://swforum.seekye.com/post/12996/#p12996</id>
		</entry>
</feed>
