PDA

View Full Version : ioservicegetmatchingservices() returning empty iterator




MayPeng
Apr 11, 2011, 11:11 PM
#define kMyDriversIOKitClassName "USBSwitchDriver"
IOServiceMatching(kMyDriversIOKitClassName);
ioservicegetmatchingservices(m_match_port, hidDictionary, &iterator);

USBSwitchDriver is a driver class name implemented by myself



kainjow
Apr 12, 2011, 09:25 PM
The code snippet doesn't say much. Can you post more code?

balamw
Apr 13, 2011, 12:46 PM
ioservicegetmatchingservices;

Shouldn't that be:


IOServiceGetMatchingServices

It is case sensitive you know!

What happens if you try to find something that isn't implemented by yourself.

B

MayPeng
Apr 19, 2011, 05:19 AM
Shouldn't that be:


IOServiceGetMatchingServices

It is case sensitive you know!

What happens if you try to find something that isn't implemented by yourself.

B

Sorry for it. Above it will appear in 64bit mac os, but 32bit os is ok.

Another problem :
My device is hid device, if I use the following code, my device can't be found.
IOHIDManagerRef mgr;

mgr = IOHIDManagerCreate(kCFAllocatorDefault, kIOHIDOptionsTypeNone);
IOHIDManagerSetDeviceDeviceMatching(mgr, NULL);
IOHIDManagerOpen(mgr, kIOHIDOptionsTypeNone);

CFSetRef device_set = IOHIDManagerCopyDevices(mgr);

CFIndex num_devices = CFSetGetCount(device_set);

.....

then I print all device fount(num_devices = 4), which are apple keyboard ,mouse and so on, my device can't be found.

Why? thank u!