Bluetooth server

From University of Washington - Ubicomp Research Page
Jump to: navigation, search

Bluetooth server is a Java MIDlet intended to handle bluetooth connections to bt-listener (on the IMote) so that other programs don't have to.

How do I use it?

First run the midlet.

Then connect to the host on TCP port 6684 (ASCII 'B' 'T'; clever, huh?).

You might want to hunt down the options to disable all the MIDlet security checks.

Why?

bt-listener is inconvenient to deal with. It uses RFCOMM. It sends and expects to receive heartbeats.

Bluetooth server handles all that. All you need to do is open the socket and read.

It also enables having multiple simultaneous connections to bt-listener. This is useful for e.g. debugging: have one program do its (sketchy) thing; have another reading the bluetooth traffic and displaying it; or maybe just log it.

Read? Not write?

Not yet anyway. Lack of asynchronous I/O in Java ME surprisingly makes this a pain.

Remote device

Specify the remote device to connect to with a file at file://e:/imote_address.txt.

For example, to connect to 00:02:5B:00:F1:12 on RFCOMM channel 2:

00:02:5B:00:F1:12;2

JAR

btio.jar revision 18

Source

Subversion

<bash>svn co svn+ssh://bicycle.cs.washington.edu/projects/ubicomp/uwar/subversion/btio/trunk btio</bash>

Prerequisites

These aren't all strictly necessary, but they're awfully convenient: