我正在尝试使用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。我试着简单地用kIODeviceTreePlane替换kIOServicePlane,但是什么也没有返回。我没有使用IOKit的经验,所以我很确定我在这里做了一些显而易见的事情。
谢谢
发布于 2010-11-20 07:47:43
弄清楚了,我只是使用了一个在IODeviceTree中不存在的类名。
https://stackoverflow.com/questions/4084068
复制相似问题