Record of some of the computer tech I deal with so that it's documented at least somewhere.

Sunday, 30 September 2007

Bluetooth at bluetongue time

A long term solution to eradicate the spread of bovine diseases is to shoot the dairy farmers.

Anyway, on with the dog & pony.
# apt-get install bluez-utils
This also auto-starts bluetooth so now the devices should see each other :
; hcitool scan
Scanning ...
00:11:22:33:44:55 Maht 00:12:D2:C5:73:56


Oh lucky me, I have a golden MAC
The bugger spends 10s scanning.

You need to advertise the Integral dongle thusly :
# dbus-send --system --dest=org.bluez /org/bluez/hci0 org.bluez.Adapter.SetMode string:discoverable

(though I added this to /etc/init.d/bluetooth on rod)

sdptool search OPUSH
That's quicker if it's cached or something, the second scan is almost instant but the first longer.

obexpushd looked like the answer but it anonomizes the received files, probably an oversight. Also the first two bytes were corrupt, and the text file was utf/unicode - that was probably some file magic at the start FFFE

Next step is PyBluez I think, see if I get any control.
# apt-get install python-bluez

F1 race now though Japan

; python
import bluetooth
bluetooth.discover_devices(duration=1,lookup_names=True)
<< [('00:11:22:33:44:55', 'Maht')]

I'm pretending the UI is the opposite for cut & paste reasons, copying python in the terminal is soooo annoying

hmm, that's just the base bt protocols, i.e. l2cap & rfcomm
Obex goes over rfcomm by the look of it
so openobex next - cripes thats not fun

next step: hack obexpushd code to see if it will bend to my will

means installing bluez-utils from source
# cd /usr/src
# apt-get source libbluetooth2
# cd bluez-libs-3.7
# ./configure
# make install
# cd .. && apt-get source libopenobex1 # though I could have sworn it was a diff lib
# cd
libopenobex-1.3
# ./configure --enable-apps
# make install
# cd /usr/src/obexpushd-0.4+svn10/src
# make

yay it worked, that means I can hack obexpushd

The loop just returns open fds to read from :(

got to work out how to get the remote address from the fd.

After I watch the F1 highlights - crazy rain smashy no hurt

trying obex_test as a better candidate

No comments: