Hi all,

The following was just recently posted to the usbvisor mailing list about
how to get a USB HandSpring Visor to automatically hotsync when the sync
button was pressed on the cradle.

It takes advantage of the devfs interface.

Thought people here might find it useful.

greg k-h

----- Forwarded message from Bob McElrath <[EMAIL PROTECTED]> -----

I've done something interesting that the list might be interested in.
People want to be able to press the hotsync button and have it sync
automatically (like in windoze?).  Using devfs and devfsd (2.3.99pre*)
kernel, devfs registers devices in the /dev/usb/tty directory for the
usb-serial module when the hotsync button is pressed.  devfsd will let
you run an arbitrary command when a new /dev entry is registered.  I
have a perl script to do my syncing for me:

    #!/bin/perl -w

    $|=1;
    $installfile = '/home/mcelrath/visor/install.list';
    chomp(@replace = `cat $installfile`);
    $dir = $ENV{PWD};
    #chdir '/home/mcelrath/visor/ShowTimes/Script/unix/';
    #print eval `cat /home/mcelrath/visor/ShowTimes/Script/unix/getdata.pl`;
    chdir $dir;
    $installcmd = '-i ' . join(" ", @replace);
    open LOG, ">/tmp/visor-sync.log";
    print LOG `pilot-xfer -p /dev/usb/tty/1 $installcmd -s
    /home/mcelrath/visor/backup 2>&1`;
    close LOG
    #print `memos -q -d /home/mcelrath/visor/memos`;

And I can get devfsd to run it for me when I press the hotsync button by
adding this line to /etc/devfsd.conf:
    REGISTER        usb/tty/1       EXECUTE sudo -u mcelrath ~mcelrath/bin/visor-sync

With these two things I can now hotsync simply by pressing the hotsync
button.  

----- End forwarded message -----

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to