【问题标题】:Getting IODeviceTree path using IOKit使用 IOKit 获取 IODeviceTree 路径
【发布时间】:2010-11-03 03:48:27
【问题描述】:

我正在尝试使用 IOKit 框架获取设备的 IODeviceTree 路径。我可以使用以下代码获取设备的 IOService 路径 (IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/SATA@B/AppleMCP79AHCI):

CFMutableDictionaryRef matchingDict = NULL;
matchingDict = IOServiceMatching("AppleMCP79AHCI");
io_service_t sataService;
io_string_t path;
sataService = IOServiceGetMatchingService(kIOMasterPortDefault, matchingDict);
IORegistryEntryGetPath(sataService, kIOServicePlane, path);
NSLog(@"%s", path);

但是,我需要在IODeviceTree 平面中获取设备的路径。在IODeviceTree 平面中,路径类似于IODeviceTree:/PCI0@0/SATA@B。我尝试简单地将kIOServicePlane 替换为kIODeviceTreePlane,但它什么也没返回。我没有使用IOKit 的经验,所以我很确定我在这里做的事情很明显。

谢谢

【问题讨论】:

    标签: c iokit macos


    【解决方案1】:

    想通了,我只是使用了 IODeviceTree 中不存在的类名。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-10
      • 1970-01-01
      • 2018-02-17
      相关资源
      最近更新 更多