8.6 Transferring Files with OpenOBEX

 <  Day Day Up  >  

OBEX (Object Exchange) is an IrDA standard (http://www.irda.org/standards/standards.asp) for transferring files between devices. OpenOBEX (http:// sourceforge .net/projects/openobex/) is an open source implementation of this standard. To install OpenOBEX, download the latest release ( openobex-x.y.z.tar.gz ), extract the tarball, then configure, compile, and install it:

 bjepson@linux:~/Documents>  tar xfz openobex-1.0.1.tar.gz  bjepson@linux:~/Documents>  cd openobex-1.0.1/  bjepson@linux:~/Documents/openobex-1.0.1>  ./configure  bjepson@linux:~/Documents/openobex-1.0.1>  make  bjepson@linux:~/Documents/openobex-1.0.1>  sudo make install  

You'll also want the applications, so download the latest release of the apps ( openobex-apps-x.y.z.tar.gz ), and go through the same steps:

 bjepson@linux:~/Documents>  tar xfz openobex-apps-1.0.0.tar.gz  bjepson@linux:~/Documents>  cd openobex-apps-1.0.0/  bjepson@linux:~/Documents/ openobex-apps-1.0.0>  ./configure  bjepson@linux:~/Documents/ openobex-apps-1.0.0>  make  bjepson@linux:~/Documents/ openobex-apps-1.0.0>  sudo make install  

(You may need to add /usr/local/lib to /etc/ld.so.conf and run ldconfig as root for everything to work.)

After you've installed the applications, you can transfer files with the irobex_palm3 utility. Don't let the "palm" in the name put you off; we've used it with cellular phones as with well as a Palm (you should be able to use any infrared device that supports OBEX). To receive files, start irobex_palm3 , initiate sending a file from your device, and align the ports. After irobex_palm3 receives the file, it exits. Here's a session where irobex_palm3 receives a business card from a Nokia phone:

 bjepson@linux:~ >  irobex_palm3  Send and receive files to Palm3 Waiting for files     ..HEADER_LENGTH = 220 Filename = Nokia.vcf Wrote /tmp/Nokia.vcf (108 bytes) 

To send a file, be sure that your device is configured to receive files via infrared, align the ports, and use irobex_palm3 filename :

 bjepson@linux:~>  irobex_palm3 sample.png  Send and receive files to Palm3     name=sample.png, size=11439 ...........     PUT successful 
 <  Day Day Up  >  


Linux Unwired
Linux Unwired
ISBN: 0596005830
EAN: 2147483647
Year: 2004
Pages: 100

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net