按照简单的教程我可以连接到设备(带有ADNS-5000芯片的usb光学鼠标)并制作批量传输.
UsbInterface intf = device.getInterface(0);
UsbEndpoint endpoint = intf.getEndpoint(0);
UsbDeviceConnection connection = manager.openDevice(device);
connection.claimInterface(intf, forceClaim);
connection.bulkTransfer(endpoint, bytes, bytes.length, TIMEOUT); //do in another thread
Run Code Online (Sandbox Code Playgroud)
ADNS-5000规范(可以用google搜索)定义了一些"USB命令",例如:
助记符:Get_Status_Device
命令:80 00 00 00 00 00 02 00
注意:通常返回00 00,自供电00 00,远程唤醒02 00
所以我理解为:当我写数据时:
private byte[] bytes = {(byte) 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00};
Run Code Online (Sandbox Code Playgroud)
我应该得到的设备0x00, 0x00
或0x00, 0x00
(这可能是规范中的错误,因为这个字节序列被定义为两个不同状态的结果)或0x20, 0x00
作为回报,但我没有看到任何方式api返回任何东西,我是对的吗?
根据以下说明:https: //gist.github.com/dergachev/3866825#vagrant-setup
Ubuntu Linaro uname -a Linux ken-desktop 3.11.0-18-generic#32-Ubuntu SMP Tue Feb 18 21:11:14 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux cat/proc/version Linux version 3.11.0-18- generic(buildd @ toyol)(gcc版本4.8.1(Ubuntu/Linaro 4.8.1-10ubuntu8))#32-Ubuntu SMP Tue 2月18日21:11:14 UTC 2014
VirtualBox虚拟-4.2
VBoxManage --version
4.2.16_Ubuntur86992
Run Code Online (Sandbox Code Playgroud)
Vagrant 1.5 vagrant_1.5.0_x86_64.deb
在cookbooks文件夹中,我克隆了以下厨师烹饪书:
git clone git://github.com/opscode-cookbooks/vim.git
git clone git://github.com/opscode-cookbooks/git.git
git clone git://github.com/opscode-cookbooks/apt.git
git clone git://github.com/tiokksar/chef-oh-my-zsh-solo.git
git clone git://github.com/opscode-cookbooks/openssl.git
git clone git://github.com/getaroom/chef-couchbase.git
Run Code Online (Sandbox Code Playgroud)
我也安装了这个:
https://github.com/dotless-de/vagrant-vbguest
vagrant plugin install vagrant-vbguest
Run Code Online (Sandbox Code Playgroud)
我尝试制作一个漂亮的Vagrantfile,用usb自动挂载创建一个精确的64虚拟机.但每次我尝试在我的虚拟机VM上添加一个usbfilter时,我最终都会收到该消息:
% vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: …
Run Code Online (Sandbox Code Playgroud)