0

I'm coding in cpp, and I want to get back linksta whice is including number of lanes and bandwidth. I know I can get it with regex in lspci -vv, but I perfer an API if someone know any.

Dima Chubarov
  • 16,199
  • 6
  • 40
  • 76
asaf
  • 1
  • 1
    Read the code of `lspci` and do what it does. Or run `strace lspci -vv` and see what system calls it makes. – John Zwinck Aug 06 '17 at 12:02
  • Check out this [post](https://stackoverflow.com/q/27420834/1328439). It doesn't consider the specific attributes you are asking about, but links to `libpci`. – Dima Chubarov Aug 06 '17 at 12:17
  • Also this [short script](https://github.com/joelandman/pcilist) should be helpful. It is actually parsing `lspci -vvvkb` – Dima Chubarov Aug 18 '17 at 04:29

0 Answers0