【发布时间】: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 的经验,所以我很确定我在这里做的事情很明显。
谢谢
【问题讨论】: