B2 :C/C++ Program to display the list of devices connected to your system including the physical names and its instance number.
Program:
#include<stdio.h>
#include<stdloib.h>
main()
{
printf(“LIST
OF DEVICES CONNECTED TO SYSTEM”);
system
("lspci");
}
Output:
cl2@Inspiron-1545:~$
g++ ex.cpp
cl2@Inspiron-1545:~$
./a.out
00:00.0 Host bridge:
Intel Corporation Mobile 4 Series Chipset Memory Controller Hub (rev 07)
00:02.0 VGA compatible
controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics
Controller (rev 07)
00:02.1 Display
controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics
Controller (rev 07)
00:1a.0 USB controller:
Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #4 (rev 03)
00:1a.1 USB controller:
Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #5 (rev 03)
00:1a.2 USB controller:
Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #6 (rev 03)
00:1a.7 USB controller:
Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #2 (rev 03)
00:1b.0 Audio device:
Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 03)
00:1c.0 PCI bridge:
Intel Corporation 82801I (ICH9 Family) PCI Express Port 1 (rev 03)
00:1c.1 PCI bridge:
Intel Corporation 82801I (ICH9 Family) PCI Express Port 2 (rev 03)
00:1c.2 PCI bridge:
Intel Corporation 82801I (ICH9 Family) PCI Express Port 3 (rev 03)
00:1c.4 PCI bridge:
Intel Corporation 82801I (ICH9 Family) PCI Express Port 5 (rev 03)
00:1d.0 USB controller:
Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 (rev 03)
00:1d.1 USB controller:
Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 (rev 03)
00:1d.2 USB controller:
Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 (rev 03)
00:1d.7 USB controller:
Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 (rev 03)
00:1e.0 PCI bridge:
Intel Corporation 82801 Mobile PCI Bridge (rev 93)
00:1f.0 ISA bridge:
Intel Corporation ICH9M LPC Interface Controller (rev 03)
00:1f.2 SATA
controller: Intel Corporation 82801IBM/IEM (ICH9M/ICH9M-E) 4 port SATA
Controller [AHCI mode] (rev 03)
00:1f.3 SMBus: Intel
Corporation 82801I (ICH9 Family) SMBus Controller (rev 03)
09:00.0 Ethernet
controller: Marvell Technology Group Ltd. 88E8040 PCI-E Fast Ethernet
Controller (rev 13)
0c:00.0 Network
controller: Broadcom Corporation BCM4312 802.11b/g LP-PHY (rev 01)
Bus 001 Device 003: ID
0bda:0158 Realtek Semiconductor Corp. USB 2.0 multicard reader
Bus 001 Device 004: ID
0c45:63ee Microdia
Bus 002 Device 003: ID
0781:5567 SanDisk Corp. Cruzer Blade
Bus 003 Device 002: ID
0a5c:4500 Broadcom Corp. BCM2046B1 USB 2.0 Hub (part of BCM2046 Bluetooth)
Bus 007 Device 002: ID
046d:c05b Logitech, Inc. M-U0004 810-001317 [B110 Optical USB Mouse]
Bus 001 Device 001: ID
1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID
1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID
1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID
1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID
1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID
1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID
1d6b:0001 Linux Foundation 1.1 root hub
Bus 008 Device 001: ID
1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 003: ID
413c:8161 Dell Computer Corp. Integrated Keyboard
Bus 003 Device 004: ID
413c:8162 Dell Computer Corp. Integrated Touchpad [Synaptics]
Bus 003 Device 005: ID
413c:8160 Dell Computer Corp. Wireless 365 Bluetooth
0 comments:
Post a Comment