In linux, view the number of usb-Linux Enterprise Application-Linux server application information. For more information, see. Hanging out in the library at noon, I saw a dictionary of linux command syntax. I flipped through it, and my eyes fell onto lsusb, listing all the usb devices. Then I suddenly shouted out. So I came back and tried:
[Lbxwz @ localhost ~] $ Lsusb
Bus 005 Device 001: ID :0000
Bus 004 Device 001: ID :0000
Bus 003 Device 001: ID :0000
Bus 002 Device 002: ID 046d: c018 Logitech, Inc.
Bus 002 Device 001: ID :0000
Bus 001 Device 001: ID :0000
It's hard to read/proc/bus/usb/device files.
It turns out that the world is so big.
Haha
I have attached a statistical program about the number of usb, which is used to read the/proc/bus/usb/device file.
Int IfExistUSBInterface (char ** USBInterfacesName)
{
FILE * FileStream;
Char * FileArr;
Char * ArrFlag;
Char * HostUsbFlag;
Char * UsbNameFlag;
Char ArrFound [] = "Product ";
Char UsbName [32] = {0}; // used to store the USB name
Int UsbNum = 0; // count the number of USB
Int FileNum = 0; // count the number of characters in the Read File
Int BufSize;
Int I;
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.