usb detection

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

  1. chhoda macrumors 6502

    Joined:
    Oct 25, 2008
    #1
    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

    --CH
     
  2. jared_kipe macrumors 68030

    jared_kipe

    Joined:
    Dec 8, 2003
    Location:
    Seattle
    #2
    You give a copy of your device to kainjow and wait for his reply.
     
  3. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #3
  4. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #4
    :D

    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