0
我试图获取使用IOKit框架的设备的IODeviceTree路径。我能够获得使用此代码的设备的IOService的路径(IOService:/AppleACPIPlatformExpert/[email protected]/AppleACPIPCI/[email protected]/AppleMCP79AHCI
):使用IOKit获取IODeviceTree路径
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:/[email protected]/[email protected]
。我试图用kIODeviceTreePlane
代替kIOServicePlane
,但它什么都没有返回。我没有IOKit
的经验,所以我很确定这里有一些明显的东西。
感谢