For JeeMon, I’d like to be able to auto-detect USB device insertions and to identify FTDI serial numbers (with names like “FTE54GKC” and “A9007CNE”).
Cross-platform… i.e. on Windows, Mac, and Linux!
It looks like it can be done.
On Windows, we can browse the good ol’ registry, as follows:

Sample output:
![]()
This was tested on Win2000 and Windows 7, in the hope that everything in between works the same.
On Mac OS X, it’s easiest (for a change):

Sample output:
![]()
On Linux, it’s a bit messy because there are so many different distributions:

Sample output:
![]()
Tested on Debian 5 (Lenny), Ubuntu 9.10 (Karmic), and Gentoo.
The above code can be found in the subversion repository, i.e. here.
I’m testing this all at once on a single machine btw, courtesy of VMware Fusion. And using JeeMon’s built-in self-update mechanism to quickly get new versions across while debugging and tweaking things.
By calling “SysDep listSerialPorts” periodically, we can automatically detect a change and see which plug was inserted (FTDI only for now). Without depending on any external libs or executables.
Onwards!