-3

ユーザー アプリから 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
4

1 に答える 1

2

egfopen("//sys/bus/usb/devices/1-1/version", "rt")を使用してファイルを開き、他のファイルと同様にその内容を読み取ります。明るさがわからない、どのファイルに入っているかは言及されておらず、その名前のファイルはありません。

于 2015-10-28T13:08:52.840 に答える