我运行在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捕获的不同.
可能是什么问题呢?