急求小说下载地址libusb0.dll

君,已阅读到文档的结尾了呢~~
打开usb_burning_tool弹出libusb0.dll报错的解决方法
扫扫二维码,随身浏览文档
手机或平板扫扫即可继续访问
打开usb_burning_tool弹出libusb0.dll报错的解决方法
举报该文档为侵权文档。
举报该文档含有违规或不良信息。
反馈该文档无法正常浏览。
举报该文档为重复文档。
推荐理由:
将文档分享至:
分享完整地址
文档地址:
粘贴到BBS或博客
flash地址:
支持嵌入FLASH地址的网站使用
html代码:
&embed src='/DocinViewer--144.swf' width='100%' height='600' type=application/x-shockwave-flash ALLOWFULLSCREEN='true' ALLOWSCRIPTACCESS='always'&&/embed&
450px*300px480px*400px650px*490px
支持嵌入HTML代码的网站使用
您的内容已经提交成功
您所提交的内容需要审核后才能发布,请您等待!
3秒自动关闭窗口2969人阅读
C/C++(62)
linux(63)
接学习一,学习二主要是看例程ok,现在最简单的想法看看有多少信息包含在你的设备里,程序代码如下#include &iostream&
#include &libusb.h&
void printdev(libusb_device *dev); //prototype of the function
int main() {
libusb_device ** //pointer to pointer of device, used to retrieve a list of devices
libusb_context *ctx = NULL; //a libusb session
//for return values
ssize_ //holding number of devices in list
r = libusb_init(&ctx); //initialize a library session
if(r & 0) {
cout&&&Init Error &&&r&& //there was an error
libusb_set_debug(ctx, 3); //set verbosity level to 3, as suggested in the documentation
cnt = libusb_get_device_list(ctx, &devs); //get the list of devices
if(cnt & 0) {
cout&&&Get Device Error&&& //there was an error
cout&&cnt&&& Devices in list.&&& //print total number of usb device
ssize_ //for iterating through the list
for(i = 0; i & i++) {
printdev(devs[i]); //print specs of this device
libusb_free_device_list(devs, 1); //free the list, unref the devices in it
libusb_exit(ctx); //close the session
void printdev(libusb_device *dev) {
libusb_device_
int r = libusb_get_device_descriptor(dev, &desc);
if (r & 0) {
cout&&&failed to get device descriptor&&&
cout&&&Number of possible configurations: &&&(int)desc.bNumConfigurations&&&
cout&&&Device Class: &&&(int)desc.bDeviceClass&&&
cout&&&VendorID: &&&desc.idVendor&&&
cout&&&ProductID: &&&desc.idProduct&&
libusb_config_descriptor *
libusb_get_config_descriptor(dev, 0, &config);
cout&&&Interfaces: &&&(int)config-&bNumInterfaces&&& ||| &;
const libusb_interface *
const libusb_interface_descriptor *
const libusb_endpoint_descriptor *
for(int i=0; i&(int)config-&bNumI i++) {
inter = &config-&interface[i];
cout&&&Number of alternate settings: &&&inter-&num_altsetting&&& | &;
for(int j=0; j&inter-&num_ j++) {
interdesc = &inter-&altsetting[j];
cout&&&Interface Number: &&&(int)interdesc-&bInterfaceNumber&&& | &;
cout&&&Number of endpoints: &&&(int)interdesc-&bNumEndpoints&&& | &;
for(int k=0; k&(int)interdesc-&bNumE k++) {
epdesc = &interdesc-&endpoint[k];
cout&&&Descriptor Type: &&&(int)epdesc-&bDescriptorType&&& | &;
cout&&&EP Address: &&&(int)epdesc-&bEndpointAddress&&& | &;
cout&&endl&&endl&&
libusb_free_config_descriptor(config);
}写完之后,编译看看会出现什么。首先运行程序并检查设备,然后连上我自己的设备在执行程序。会发现有新的内容出现,可以根据vendor id和product id发现这正是我自己连上打开的设备。注意:发现设备(调用libusb_get_device_list())会返回新的内存分配的设备队列。当你完成这个队列的使用后必须释放他。Libusb同样需要知道当一切完成时清除队列的内容;设备的本身。为处理这些问题,libusb提供了两个单独的条目:一个释放队列本身的函数一个针对设备内部的参考计数系统新的设备由libusb_get_device_list()函数展示,都拥有一个参考计数1。你可以使用libubs_ref_device()和libusb_unref_device()增加或减少参考计数。当一个设备的参考计数为0时,该设备就被销毁通过以上的信息,打开设备的基本流程可以视为如下步骤:1. 使用libusb_get_device_list()发现设备;2. 选择你想操作的设备,调用libusb_open();3. 在设备队列中unref所有的设备;4. 释放已经发现的设备队列;这个次序是十分重要的,在尝试打开设备之前,你不能够unreference设备,因此unreference操作有可能导致设备的销毁。为了方便起见,libusb_free_device_list()函数包含一个参数,在释放队列本身前,该参数能够选择性地在队列中unreference所有设备。这包含了以上的步骤3和步骤4。如果还有需要,可以去libusb1’s API(http://libusb.sourceforge.net/api-1.0/index.html)文档参考你需要的函数。好了,现在你可以找到你需要的设备了。现在是打开设备,请求并且执行一个简单的I/O。如果你知道vendor ID和prouct ID,使用libusb_open_device_with_vid_pid。另外需要注意的,如果内核(你的OS)已经连接到这个设备,你将无法请求到它。在这种情况下,你需要调用libusb_detach_kernel_drive来从内核中检测设备。如果你想知道内核是否可用的,使用libusb_kernel_drive_active,如果返回值为1,对于你的设备内核可以加载驱动。批量传输为了在你的设备上使用批量传输,你应该获得为你的USB设备获得一个设备句柄,并且你应该知道使用哪个端点(从之前设备说明获得)。关于语法上的信息参考这里(http://libusb.sourceforge.net/api-1.0/group__syncio.html#gab8ae853ab492c22dc8a805)这里有个简单的例子包含所有我提到的相关部分:#include &iostream&
#include &libusb.h&
int main() {
libusb_device ** //pointer to pointer of device, used to retrieve a list of devices
libusb_device_handle *dev_ //a device handle
libusb_context *ctx = NULL; //a libusb session
//for return values
ssize_ //holding number of devices in list
r = libusb_init(&ctx); //initialize the library for the session we just declared
if(r & 0) {
cout&&&Init Error &&&r&& //there was an error
libusb_set_debug(ctx, 3); //set verbosity level to 3, as suggested in the documentation
cnt = libusb_get_device_list(ctx, &devs); //get the list of devices
if(cnt & 0) {
cout&&&Get Device Error&&& //there was an error
cout&&cnt&&& Devices in list.&&&
dev_handle = libusb_open_device_with_vid_pid(ctx, ); //these are vendorID and productID I found for my usb device
if(dev_handle == NULL)
cout&&&Cannot open device&&&
cout&&&Device Opened&&&
libusb_free_device_list(devs, 1); //free the list, unref the devices in it
unsigned char *data = new unsigned char[4]; //data to write
data[0]='a';data[1]='b';data[2]='c';data[3]='d'; //some dummy values
//used to find out how many bytes were written
if(libusb_kernel_driver_active(dev_handle, 0) == 1) { //find out if kernel driver is attached
cout&&&Kernel Driver Active&&&
if(libusb_detach_kernel_driver(dev_handle, 0) == 0) //detach it
cout&&&Kernel Driver Detached!&&&
r = libusb_claim_interface(dev_handle, 0); //claim interface 0 (the first) of device (mine had jsut 1)
if(r & 0) {
cout&&&Cannot Claim Interface&&&
cout&&&Claimed Interface&&&
cout&&&Data-&&&&data&&&&-&&& //just to see the data we want to write : abcd
cout&&&Writing Data...&&&
r = libusb_bulk_transfer(dev_handle, (2 | LIBUSB_ENDPOINT_OUT), data, 4, &actual, 0); //my device's out endpoint was 2, found with trial- the device had 2 endpoints: 2 and 129
if(r == 0 && actual == 4) //we wrote the 4 bytes successfully
cout&&&Writing Successful!&&&
cout&&&Write Error&&&
r = libusb_release_interface(dev_handle, 0); //release the claimed interface
if(r!=0) {
cout&&&Cannot Release Interface&&&
cout&&&Released Interface&&&
libusb_close(dev_handle); //close the device we opened
libusb_exit(ctx); //needs to be called to end the
delete[] //delete the allocated memory for data
}结尾:这个教程对于这个话题来说是十分简单的介绍,需要时间需联系同步传输,然后移动是异步的,这还有很多需要学习。希望这些对你的初学有帮助。原文连接:
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:542523次
积分:7317
积分:7317
排名:第1963名
原创:135篇
转载:191篇
评论:282条
(2)(5)(1)(1)(3)(6)(1)(5)(2)(5)(4)(5)(6)(6)(6)(5)(1)(5)(11)(8)(11)(6)(4)(22)(7)(20)(10)(27)(10)(10)(9)(7)(13)(12)(10)(10)(8)(11)(8)(11)(8)(4)关于libusb-win32的问题
[问题点数:40分,结帖人redsmoke007]
关于libusb-win32的问题
[问题点数:40分,结帖人redsmoke007]
不显示删除回复
显示所有回复
显示星级回复
显示得分回复
只显示楼主
本帖子已过去太久远了,不再提供回复功能。推荐使用、下载,请使用解压文件;
下载本站资源,如服务器暂不能下载请过一段时间再试;
本站资源通过、系列杀毒软件检测,请放心下载;
本站部分资源供学习交流使用,如商业用途,请购正版。
在下列搜索引擎中查找关于"libusb0.dll"的信息
评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
& 下一篇:
请输入DLL文件的名称:
增值电信业务经营许可证:苏B2-CopyRight ©
All Rights reserved.

我要回帖

更多关于 急求小说下载地址 的文章

 

随机推荐