Для моей панели инструментов последовательной связи я хочу использовать встроенные функции macOS bash / Terminal. Тем не менее, я не могу найти «правильную» документацию для конкретной команды ioreg
, и man ioreg
также непросто понять. Например, команда:
ioreg -r -c IOUSBHostDevice -l
возвращает приведенные ниже результаты для Arduino Uno в формате «иерархическое дерево с иерархической структурой реестра»:
+-o Arduino Uno@14100000 <class IOUSBHostDevice, id 0x100001201, registered, matched, active, busy 0 (3913 ms), retain 25>
| {
| "sessionID" = 17679814164580
| "USBSpeed" = 1
| "IOServiceLegacyMatchingRegistryID" = 4294971907
| "idProduct" = 67
| "bDeviceClass" = 2
| "IOPowerManagement" = {"PowerOverrideOn"=Yes,"CapabilityFlags"=32768,"MaxPowerState"=2,"DevicePowerState"=2,"ChildrenPowerState"=1,"DriverPowerState"=0,"CurrentPowerState"=2}
| "bcdDevice" = 1
| "USB Product Name" = "Arduino Uno"
| "AppleUSBAlternateServiceRegistryID" = 4294971907
| "locationID" = 336592896
| "kUSBSerialNumberString" = "7563331313335171B150"
| "bDeviceSubClass" = 0
| "kUSBCurrentConfiguration" = 1
| "IOCFPlugInTypes" = {"9dc7b780-9ec0-11d4-a54f-000a27052861"="IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle"}
| "bDeviceProtocol" = 0
| "USBPortType" = 0
| "USB Vendor Name" = "Arduino Srl "
| "idVendor" = 10755
| "USB Serial Number" = "7563331313335171B150"
| "IOGeneralInterest" = "IOCommand is not serializable"
| "kUSBVendorString" = "Arduino Srl "
| "IOClassNameOverride" = "IOUSBDevice"
| }
|
+-o AppleUSBHostLegacyClient <class AppleUSBHostLegacyClient, id 0x100001204, !registered, !matched, active, busy 0, retain 8>
| {
| "IOPowerManagement" = {"DevicePowerState"=0,"CurrentPowerState"=1,"CapabilityFlags"=65536,"MaxPowerState"=2,"DriverPowerState"=1}
| }
|
+-o AppleUSBCDCCompositeDevice <class AppleUSBCDCCompositeDevice, id 0x10000120a, !registered, !matched, active, busy 0, retain 4>
| {
| "IOProbeScore" = 58000
| "CFBundleIdentifier" = "com.apple.driver.usb.cdc"
| "IOProviderClass" = "IOUSBHostDevice"
| "IOClass" = "AppleUSBCDCCompositeDevice"
| "bDeviceSubClass" = "*"
| "IOMatchCategory" = "IODefaultMatchCategory"
| "kUSBPreferredConfiguration" = 1
| "bDeviceClass" = 2
| "bDeviceProtocol" = "*"
| }
|
+-o IOUSBHostInterface@0 <class IOUSBHostInterface, id 0x10000120b, registered, matched, active, busy 0 (2 ms), retain 10>
| | {
| | "USBPortType" = 0
| | "IOCFPlugInTypes" = {"2d9786c6-9ef3-11d4-ad51-000a27052861"="IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle"}
| | "bcdDevice" = 1
| | "USBSpeed" = 1
| | "idProduct" = 67
| | "bConfigurationValue" = 1
| | "bInterfaceSubClass" = 2
| | "locationID" = 336592896
| | "IOGeneralInterest" = "IOCommand is not serializable"
| | "IOServiceLegacyMatchingRegistryID" = 4294971917
| | "IOClassNameOverride" = "IOUSBInterface"
| | "AppleUSBAlternateServiceRegistryID" = 4294971917
| | "idVendor" = 10755
| | "bInterfaceProtocol" = 1
| | "bAlternateSetting" = 0
| | "bInterfaceNumber" = 0
| | "bInterfaceClass" = 2
| | }
| |
| +-o AppleUSBACMControl <class AppleUSBACMControl, id 0x100001213, registered, matched, active, busy 0 (0 ms), retain 7>
| {
| "IOProbeScore" = 60000
| "CFBundleIdentifier" = "com.apple.driver.usb.cdc.acm"
| "IOProviderClass" = "IOUSBHostInterface"
| "IOClass" = "AppleUSBACMControl"
| "bInterfaceClass" = 2
| "IOMatchCategory" = "IODefaultMatchCategory"
| "bInterfaceSubClass" = 2
| "bInterfaceProtocol" = 1
| }
|
+-o IOUSBHostInterface@1 <class IOUSBHostInterface, id 0x10000120c, registered, matched, active, busy 0 (3911 ms), retain 7>
| {
| "USBPortType" = 0
| "IOCFPlugInTypes" = {"2d9786c6-9ef3-11d4-ad51-000a27052861"="IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle"}
| "Product Name" = "Arduino Uno"
| "bcdDevice" = 1
| "USBSpeed" = 1
| "idProduct" = 67
| "bConfigurationValue" = 1
| "bInterfaceSubClass" = 0
| "locationID" = 336592896
| "IOGeneralInterest" = "IOCommand is not serializable"
| "IOServiceLegacyMatchingRegistryID" = 4294971919
| "IOClassNameOverride" = "IOUSBInterface"
| "AppleUSBAlternateServiceRegistryID" = 4294971919
| "idVendor" = 10755
| "bInterfaceProtocol" = 0
| "bAlternateSetting" = 0
| "bInterfaceNumber" = 1
| "bInterfaceClass" = 10
| }
|
+-o AppleUSBACMData <class AppleUSBACMData, id 0x100001216, registered, matched, active, busy 0 (0 ms), retain 6>
| {
| "IOClass" = "AppleUSBACMData"
| "CFBundleIdentifier" = "com.apple.driver.usb.cdc.acm"
| "IOProviderClass" = "IOUSBHostInterface"
| "IOTTYBaseName" = "usbmodem"
| "idProduct" = 67
| "IOProbeScore" = 49999
| "bInterfaceSubClass" = 0
| "HiddenPort" = Yes
| "IOMatchCategory" = "IODefaultMatchCategory"
| "idVendor" = 10755
| "IOTTYSuffix" = "14101"
| "bInterfaceClass" = 10
| }
|
+-o IOSerialBSDClient <class IOSerialBSDClient, id 0x100001217, registered, matched, active, busy 0 (0 ms), retain 5>
{
"IOClass" = "IOSerialBSDClient"
"CFBundleIdentifier" = "com.apple.iokit.IOSerialFamily"
"IOProviderClass" = "IOSerialStreamSync"
"IOTTYBaseName" = "usbmodem"
"IOSerialBSDClientType" = "IORS232SerialStream"
"IOProbeScore" = 1000
"IOCalloutDevice" = "/dev/cu.usbmodem14101"
"IODialinDevice" = "/dev/tty.usbmodem14101"
"IOMatchCategory" = "IODefaultMatchCategory"
"IOTTYDevice" = "usbmodem14101"
"IOResourceMatch" = "IOBSD"
"IOTTYSuffix" = "14101"
}
, с которым мне трудно разобраться,Части, которые я хотел бы понять:
- что это за дочерние ветви:
+-o Arduino Uno
|
+-o AppleUSBHostLegacyClient
|
+-o AppleUSBCDCCompositeDevice
|
+-o IOUSBHostInterface@0
| |
| +-o AppleUSBACMControl
|
+-o IOUSBHostInterface@1
|
+-o AppleUSBACMData
|
+-o IOSerialBSDClient
что IOPowerManagement
свойство / тег иего под-свойства PowerOverrideOn
, CapabilityFlags
, MaxPowerState
, DevicePowerState
, ChildrenPowerState
, DriverPowerState
и CurrentPowerState
, означают? Люди использовали это свойство, чтобы определить, включен ли экран Mac или находится в спящем режиме, и я хочу узнать, есть ли там полезная информация о последовательном устройстве.
Я хочу знать, есть ли какая-либо информация о максимальной скорости передачи в бодах, максимальном размере аппаратного / программного буфера ... Я не смог получить эту информацию из stty
, system_profiler
и kextstat
тоже.
Буду признателен, если вы поможете мне понять вышеуказанные результаты и найти информацию, которую я ищу. Спасибо за вашу поддержку заранее.