문제

I'm trying to get the IODeviceTree path of a device using the IOKit framework. I'm able to get the IOService path (IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/SATA@B/AppleMCP79AHCI) of the device using this code:

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);

However, I need to get the path for the device in the IODeviceTree plane. In the IODeviceTree plane, the path would be something like IODeviceTree:/PCI0@0/SATA@B. I tried simply replacing kIOServicePlane with kIODeviceTreePlane but it returned nothing. I have no experience with IOKit, so I'm pretty sure theres something obvious I'm doing here.

Thanks

도움이 되었습니까?

해결책

Figured it out, I was just using a class name that didn't exist in the IODeviceTree.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top