-
大小: 65.73MB文件類型: .zip金幣: 2下載: 1 次發布日期: 2023-01-25
- 語言: C#
- 標簽: C#??USB通信??DotNetUSBLib??
資源簡介
本資源是使用C#和DotNetUSBLib開發的USB通信實例程序,使用VS2015+Devexpress編寫,可以結合我的相關博文進行學習實驗
代碼片段和文件信息
//?Copyright??2006-2010?Travis?Robinson.?All?rights?reserved.
//?
//?website:?http://sourceforge.net/projects/libusbdotnet
//?e-mail:??libusbdotnet@gmail.com
//?
//?This?program?is?free?software;?you?can?redistribute?it?and/or?modify?it
//?under?the?terms?of?the?GNU?General?Public?License?as?published?by?the
//?Free?Software?Foundation;?either?version?2?of?the?License?or?
//?(at?your?option)?any?later?version.
//?
//?This?program?is?distributed?in?the?hope?that?it?will?be?useful?but?
//?WITHOUT?ANY?WARRANTY;?without?even?the?implied?warranty?of?MERCHANTABILITY
//?or?FITNESS?FOR?A?PARTICULAR?PURPOSE.??See?the?GNU?General?Public?License
//?for?more?details.
//?
//?You?should?have?received?a?copy?of?the?GNU?General?Public?License?along
//?with?this?program;?if?not?write?to?the?Free?Software?Foundation?Inc.
//?51?Franklin?Street?Fifth?Floor?Boston?MA??02110-1301?USA.?or?
//?visit?www.gnu.org.
//?
//?
using?LibUsbDotNet.LudnMonoLibUsb;
using?LibUsbDotNet.WinUsb;
namespace?LibUsbDotNet
{
????///?
????///?The? ?interface?contains?members?needed?to?configure?a?USB?device?for?use.?
????///?
????///?
????///?Only?“whole“?usb?devices?have?a? ?interface?such?as?a?
????///? ?or?a? .?This?indicates
????///?the?USB?device?must?be?properly?configured?by?the?user?before?it?can?be?used.
????///?Partial?or?interfaces?of?devices?such?as?a? ?do?not?have?an? ?
????///?interface.?This?indicates?that?the?driver?is?handling?device?configuration.
????///?
????///?
????///?This?example?uses?the? ?interface?to?select?the?desired?configuration?and?interface
????///?for?usb?devices?that?require?it.
????///?
????///?
????public?interface?IUsbDevice?:?IUsbInterface
????{
????????///?
????????///?Sets?the?USB?devices?active?configuration?value.?
????????///?
????????///?The?active?configuration?value.?A?zero?value?means?the?device?is?not?configured?and?a?non-zero?value?indicates?the?device?is?configured.
????????///?True?on?success.
????????///?
????????///?A?USB?device?can?have?several?different?configurations?but?only?one?active?configuration.
????????///?
????????bool?SetConfiguration(byte?config);
????????///?
????????///?Gets?the?USB?devices?active?configuration?value.?
????????///?
????????///?The?active?configuration?value.?A?zero?value?means?the?device?is?not?configured?and?a?non-zero?value?indicates?the?device?is?configured.
????????///?True?on?success.
????????bool?GetConfiguration(out?byte?config);
????????///?
????????///?Sets?an?alternate?interfa
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-11-02?13:43??USBTest\
?????目錄???????????0??2017-09-12?10:29??USBTest\Backup\
?????目錄???????????0??2017-09-12?10:29??USBTest\Backup\Desc
?????文件????????2028??2010-07-09?00:41??USBTest\Backup\Desc
?????文件????????2712??2010-07-09?00:41??USBTest\Backup\Desc
?????文件????????4002??2010-07-09?00:41??USBTest\Backup\Desc
?????文件?????????981??2010-07-09?00:41??USBTest\Backup\Desc
?????文件????????4541??2010-07-09?00:41??USBTest\Backup\Desc
?????文件????????2769??2010-07-09?00:41??USBTest\Backup\Desc
?????文件???????10651??2010-07-09?00:41??USBTest\Backup\Desc
?????文件????????5490??2010-07-09?00:41??USBTest\Backup\Desc
?????文件????????5113??2010-07-09?00:41??USBTest\Backup\Desc
?????目錄???????????0??2017-09-12?10:29??USBTest\Backup\DeviceNotify\
?????文件????????1830??2010-07-09?00:41??USBTest\Backup\DeviceNotify\DeviceNotifier.cs
?????文件????????3912??2010-07-09?00:41??USBTest\Backup\DeviceNotify\DeviceNotifyEventArgs.cs
?????文件????????1870??2010-07-09?00:41??USBTest\Backup\DeviceNotify\DeviceType.cs
?????文件????????2219??2010-07-09?00:41??USBTest\Backup\DeviceNotify\EventType.cs
?????文件????????2089??2010-07-09?00:41??USBTest\Backup\DeviceNotify\IDeviceNotifier.cs
?????目錄???????????0??2017-09-12?10:29??USBTest\Backup\DeviceNotify\Info\
?????文件????????1737??2010-07-09?00:41??USBTest\Backup\DeviceNotify\Info\IPortNotifyInfo.cs
?????文件????????2575??2010-07-09?00:41??USBTest\Backup\DeviceNotify\Info\IUsbDeviceNotifyInfo.cs
?????文件????????2373??2010-07-09?00:41??USBTest\Backup\DeviceNotify\Info\IVolumeNotifyInfo.cs
?????文件????????2333??2010-07-09?00:41??USBTest\Backup\DeviceNotify\Info\PortNotifyInfo.cs
?????文件????????3940??2010-07-09?00:41??USBTest\Backup\DeviceNotify\Info\UsbDeviceNotifyInfo.cs
?????文件????????3912??2010-07-09?00:41??USBTest\Backup\DeviceNotify\Info\VolumeNotifyInfo.cs
?????目錄???????????0??2017-09-12?10:29??USBTest\Backup\DeviceNotify\Internal\
?????文件????????1548??2010-07-09?00:41??USBTest\Backup\DeviceNotify\Internal\DevBroadcastDeviceinterface.cs
?????文件????????1289??2010-07-09?00:41??USBTest\Backup\DeviceNotify\Internal\DevBroadcastHdr.cs
?????文件????????1354??2010-07-09?00:41??USBTest\Backup\DeviceNotify\Internal\DevBroadcastPort.cs
?????文件????????1353??2010-07-09?00:41??USBTest\Backup\DeviceNotify\Internal\DevBroadcastVolume.cs
?????文件????????2610??2010-07-09?00:41??USBTest\Backup\DeviceNotify\Internal\DevNotifyNativeWindow.cs
............此處省略656個文件信息
評論
共有 條評論