小编SOS*_*SOS的帖子

为什么使用Perl的Device :: USB进行USB批量传输会被切断?

我运行在Linux上运行的Perl代码:

my $command = "\x{11}\x{22}\x{33}\x{44}\x{55}\x{66}\x{77}\x{88}\x{00}\x{00}\x{00}\x{00}\x{00}\x{00}\x{00}\x{00}\x{00}\x{00}\x{00}\x{00}"; # total of 20 bytes to transmit
my $bytesWritten = $device->bulk_write(0x01, $command, 1000);
Run Code Online (Sandbox Code Playgroud)

使用Wireshark,我发现传输的实际应用程序数据是

0000    00 00 00 00 00 00 00 00    00 00 00 00 00 00 00 00
0010    00 00 00 00 00 00 00 00    11 22 33 44
Run Code Online (Sandbox Code Playgroud)

打印$bytesWritten显示传输了20个字节,但这与Wireshark捕获的不同.

可能是什么问题呢?

linux usb perl

19
推荐指数
1
解决办法
938
查看次数

标签 统计

linux ×1

perl ×1

usb ×1