usb detection

Discussion in 'Mac Programming' started by chhoda, Aug 27, 2010.

  1. chhoda macrumors 6502

    Oct 25, 2008
    I need to solve a problem, where I need to write an application which gets called after a certain usb device is inserted into my mac. how would I do that ?

    are there more than one ways ? can I do it in java ? can anybody point me to some examples

  2. jared_kipe macrumors 68030


    Dec 8, 2003
    You give a copy of your device to kainjow and wait for his reply.
  3. chown33 macrumors 604

    Aug 9, 2009
    Sailing beyond the sunset
  4. kainjow Moderator emeritus


    Jun 15, 2000

    If you know C it's not too hard to write a daemon that works with the IOHID API to get connect/disconnect notifications for your device which you could then use to launch your Java app.

    Just use the code in the URL above and modify it to detect your device.

    I imagine there is some Java/USB library out there somewhere though... maybe someone ported libusb.

Share This Page