ioservicegetmatchingservices() returning empty iterator

Discussion in 'Mac Programming' started by MayPeng, Apr 11, 2011.

  1. macrumors member

    Joined:
    Nov 21, 2010
    #1
    #define kMyDriversIOKitClassName "USBSwitchDriver"
    IOServiceMatching(kMyDriversIOKitClassName);
    ioservicegetmatchingservices(m_match_port, hidDictionary, &iterator);

    USBSwitchDriver is a driver class name implemented by myself
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    The code snippet doesn't say much. Can you post more code?
     
  3. Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #3
    Shouldn't that be:

    Code:
    IOServiceGetMatchingServices
    It is case sensitive you know!

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

    B
     
  4. thread starter macrumors member

    Joined:
    Nov 21, 2010
    #4
    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!
     

Share This Page