CABLE-OBEX v0.2.4

This is Cable OBEX, or Cobex for short, a small utility/library for talking to (not in, hahaha)
a cellphone using OBEX over a serial cable. For a full-featured Open Source OBEX implementation,
see the OpenOBEX project, http://openobex.sourceforge.net/ . I think their primary focus is IrDA
and Bluetooth, and I never got it to work over a serial cable, thus this project.

Cobex has been successfully tested with the SonyEricsson phones T610, T310 and T300 using a DCU-11
USB/Serial cable. Other phones might work, PLEASE report any succes you have with it.

This project includes the three utilities, cobex_put, cobex_get and cobex_ls. That's right, now
you can get files from a T610, NOT a T300/T310. An added bonus is the modeldb sub-project.

REQUIREMENTS:

Full GNU toolchain, ie. GCC etc. Cygwin might work also!
ezv24 from http://ezv24.sourceforge.net/
expat from http://expat.sourceforge.net/

INSTALL:

Install the required libraries . If they are not installed in the usual places, you will have 
to modify the Makefile. Come on, a configure script with all it's fluff would be several 
times larger than this entire project.

When ezV24 and expat are in place, do a simple "make" and the project should build. 

Should you need to change the baudrate, you have to edit main.c and recompile. It is
set to 9600 baud by default, as that is what the SE T310/T610 and DCU-11 seem to do.

USAGE:

cobex_get <device> <filename>
cobex_ls <device> <filename>
cobex_put <device> <infile> <name-on-device>

Note,
- For cobex_get, use redirection or pipes to get the file to disk, or where you want it.
- Since v0.2.4, cobex_get has a bit better path handling. This means that
  you don't have to separate the filename into name and dir manually. It also sortof handles the
  telecom subtree, that isn't a tree at all, but filenames with / in them. 
- cobex_put puts a file to the Inbox, and let's the phone sort it out where it should end,
  putting directly to a directory is currently not supported.
- It should be exceedingly simple to make an kio_cobex.

For fun, you could try fetching telecom/rtc.txt (the clock) and telecom/devinfo.txt (the 
device presents it's features).

MODELDB:

Included is the tiny subproject modeldb. This is a tool to autodetect what's 
connected to a serial port. Usage is simple:

dodetect <device>

Curently, the model db in the phones.xml file holds four different phones and software
revisions, PLEASE email me the responses from your phone and I will include them in the 
database. You need to recompile if you add a new phone. 

Example:

./cobex_ls /dev/ttyUSB0 ""

will list the files in top level directory on the phone.

LICENSING:

GNU General Public License Version 2. Go fetch the license text from the usual places.

Notes about T300/T310:
 
The OBEX implementation in the T310 is ... well, it's not very exhaustive. It
doesn't seem to support GET for example. That's right, there doesn't seem to be any way to
transfer things from a phone to a computer using the serial cable. Of course, you can beam
objects to a computer, using a IrDA device and OpenOBEX/ircp, but unless you have a laptop
with a builtin IrDA device, the support for IrDA devices, ie. IrDA dongles, under Linux is
not good.

In some cases, the implementation in the phone is not even compliant with the specification.
If you try to GET an object you will get no response. None whatsoever. In fact, if you try
you will lock up the OBEX server in the phone, and you will have to restart it. The phone,
that is. You need to powertoggle it.

You don't need OBEX to fetch the phonebook or SMSs, or check the battery and signal status,
you can do that directly with AT commands.

HINTS:

The DCU-11 cable is supported in Linux 2.4.21 using the pl2303-driver. However, the pl2303
can be modified to support the DCU-11 cable in earlier versions, at least 2.4.18 and possibly
all the way back to pre 2.4. Bascially, if you modify the pl2303 driver to recognize the DCU-11
cable vendor and product ID, you're there. The vendor:product ID for the DCU-11 is 0x0731:0x0528.

I use this line to compile the pl2303 driver out of the kernel tree:

gcc -Wstrict-prototypes -Wno-trigraphs -fomit-frame-pointer -fno-strict-aliasing  \
-fno-common -D__KERNEL__ -DMODULE -DNOKERNEL -I/lib/modules/`uname -r`/build/include  \
-O2  -Wall -Wstrict-prototypes -fomit-frame-pointer -pipe -DMODULE -D__KERNEL__  \
-DEXPORT_SYMTAB -DMODVERSIONS -c pl2303.c

Contact:

Fredrik Srensson, sorn73 at yahoo dot com
