2 posts / 0 new
Last post
fwagner.clarity
Device feature in SDK 3.7
In SDK 2.8, I might get device features, used next code: private IDevice _device; foreach (var feature in Enum.GetValues(typeof(FeatureType)))             {                 var featureName = feature.ToString();                 var isUse = this._device.HostCommand.IsSupported((FeatureType)feature);             } How can I get them into 3.7? Sorry for my bad English.

lcollins
Hi,<br /> <br /> Thanks for the question.<br /> <br /> The features API can still be used in 3.7 but only when using our Native API option (C++). The &quot;IsSupported&quot; member and &quot;eFeatureType&quot; enum is not exposed via our COM APIs (C++ or C#).<br /> <br /> Here is some Native API C++ code that enumerates the features of IDevice:<br /> <br /> &nbsp;&nbsp;&nbsp; for (int i = FEATURE_TYPE_ANTI_STARTLE; i != FEATURE_TYPE_HID2_DEVICE+1; i++)<br /> &nbsp;&nbsp;&nbsp; {<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eFeatureType feature = static_cast&lt;eFeatureType&gt;(i);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cout &lt;&lt; featureToString(feature) &lt;&lt; &quot; is supported? &quot;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;&lt; (hostCommand-&gt;isSupported(feature) == 1 ? &quot;Yes&quot; : &quot;No&quot;) &lt;&lt; endl;<br /> &nbsp;&nbsp;&nbsp; }<br /> <br /> Here is a ZIP file containing a modified native sample to include the above: <a href="/system/files/Features%20API%20support%20in%20Native%20API.zip">/system/files/Features%20API%20support%20in%20Native%20API.zip</a><br /> <br /> and here is an image of the sample in action: <a href="/files/features-api-supportpng">/files/features-api-supportpng</a><br /> <br /> Let me know if that helps,<br /> Thanks,<br /> Lewis.

Add new comment