The rawread tool is a command-line utility used to read raw data from a specific USB device. It allows you to target a device using either its VID:PID or its bus:address. You can specify the configuration, interface, alternate setting, and endpoint to read from, and optionally use streams for prefetching data via multiple buffer transfers.
Usage Pattern
- Identify the device: Use
--vidpid (e.g., 1d6b:0002) or --busaddr (e.g., 1:1). - Configure the connection: Specify
--config, --interface, --alternate, and --endpoint (the number without the leading 0x8). - Set read parameters: Use
--read_size for transaction size, --buffer_size for prefetching (enables streaming), and --read_num for the number of transactions (0 for infinite). - Set timeouts: Use
--timeout to limit the execution duration.
# Example: Read from a device with VID 1d6b and PID 0002, using interface 0, endpoint 1, with a 1024 byte read size
./rawread --vidpid 1d6b:0002 --interface 0 --endpoint 1 --read_size 1024
# Example: Read using bus:address with prefetching (buffer_size > 1)
./rawread --busaddr 1:5 --buffer_size 4 --read_size 512