Obtener ruta IODeviceTree usando IOKit
Pregunta
Estoy tratando de obtener la ruta IODeviceTree de un dispositivo mediante el marco IOKit. Soy capaz de obtener la ruta IOService (IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/SATA@B/AppleMCP79AHCI
) del dispositivo utilizando este código:
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);
Sin embargo, necesito para obtener la ruta para el dispositivo en el plano IODeviceTree
. En el plano IODeviceTree
, el camino sería algo así como IODeviceTree:/PCI0@0/SATA@B
. Probé con la simple sustitución de kIOServicePlane
kIODeviceTreePlane
pero volvió nada. No tengo ninguna experiencia con IOKit
, así que estoy bastante seguro de que hay algo obvio que estoy haciendo aquí.
Gracias
Solución
figurado a cabo, sólo estaba usando un nombre de clase que no existía en el IODeviceTree.