I would like to launch a program automatically when I connect my arduino hardware into my laptop.
I know it is kind of possible because that's the way Itunes works when i connect my ipod.
Sorry if my question is too broad, but it's because of my lacks of acknowledgment of USB technology and driver development. I will clarify my question according to the answers.
I have found a topic with dmesg (http://www.freebsd.org/doc/handbook/usb-disks.html), but on my Mac OSX, the response is not the same as the example (I have a lot of code signing error and there's lot of output informations). So I'm assuming that's depending of the OS.
What my question is about is if there is a standardized way to detect an USB port, or if it is OS dependent (my question is for unix family only).
For the moment, the solution I have found is to take a cron and scan the tty. file and check if it can respond to my signal, and if it can, I launch my program. But that is really a dirty agressive solution.
I haven't any clear documentation about it. But that only because I don't know where to find the documentation. I know that usbconfig can give information about a device, but it's not pre installed into mac machine.
So, does the kernel can provide signals when an hardware is connected? Where should I provide the information of my hardware to the computer? Is it OS specific? And where I can find the documentation for what I want (i haven't found a clear way for a research) ?
Help will be greatly appreciated. Thank you for the response!