IOKitフレームワークを使用してデバイスのIODeviceTreeパスを取得しようとしています。IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/SATA@B/AppleMCP79AHCI
次のコードを使用して、デバイスのIOServiceパス()を取得できます。
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
ので、私がここでやっていることは明らかなことだと確信しています。
ありがとう