我如何从用户应用程序中读取 sysfs 属性。它与 cat 命令的内容相似。比如我有一个标签是亮度。如何获得亮度标签的值?因为我需要从我的应用程序中读取 USB 信息,并且我看到它们被导出到 sysfs,如下面的拓扑:
ls /sys/bus/usb/devices/1-1
1-1:1.0 busnum port
authorized configuration power
avoid_reset_quirk descriptors product
bConfigurationValue dev quirks
bDeviceClass devnum removable
bDeviceProtocol devpath remove
bDeviceSubClass driver serial
bMaxPacketSize0 ep_00 speed
bMaxPower idProduct subsystem
bNumConfigurations idVendor uevent
bNumInterfaces ltm_capable urbnum
bcdDevice manufacturer version
bmAttributes maxchild