Dobrica Pavlinušić's random unstructured stuff
Bluetooth: Revision 9
This page will try to document my long-living dream of having bluetooth software keyboard HID
serial port and other stuff

{toc}

^ xkbd-bthid : a software Bluetooth HID Keyboard

* http://mulliner.org/bluetooth/xkbdbthid.php

^^ My Changes

{fetchrss http://git.rot13.org/?p=xkbdbthid.git;a=rss full}

---

^ serial SP

^^ modify systemd script

.pre
tab:~# sdptool browese local
Failed to connect to SDP server on FF:FF:FF:00:00:00: No such file or directory

tab:~# vi /etc/systemd/system/bluetooth.target.wants/bluetooth.service

#ExecStart=/usr/lib/bluetooth/bluetoothd
# make sdptool browse local work again!
ExecStart=/usr/lib/bluetooth/bluetoothd --compat

tab:~# systemctl daemon-reload
tab:~# systemctl restart bluetooth.service


.pre

^^ bring up device and make it discoverable

.pre
root@rpi2:~# hciconfig
hci0: Type: BR/EDR Bus: UART
BD Address: B8:27:EB:A3:88:32 ACL MTU: 1021:8 SCO MTU: 64:1
DOWN
RX bytes:9088 acl:39 sco:0 events:343 errors:0
TX bytes:8208 acl:44 sco:0 commands:265 errors:0

root@rpi2:~# hciconfig hci0 up

root@rpi2:~# hciconfig
hci0: Type: BR/EDR Bus: UART
BD Address: B8:27:EB:A3:88:32 ACL MTU: 1021:8 SCO MTU: 64:1
UP RUNNING PSCAN
RX bytes:9784 acl:39 sco:0 events:382 errors:0
TX bytes:8967 acl:44 sco:0 commands:304 errors:0

root@rpi2:~# hciconfig hci0 piscan
.pre


^^ serial server

.pre
root@nuc:~# sdptool browse local | grep SP
root@nuc:~# sdptool add --channel=3 SP
Serial Port service registered
root@nuc:~# mknod -m 666 /dev/rfcomm0 c 216 0
root@nuc:~# rfcomm watch /dev/rfcomm0 3 /sbin/agetty rfcomm0 115200 linux
Waiting for connection on channel 3
Connection from B8:27:EB:A3:88:32 to /dev/rfcomm0
Press CTRL-C for hangup
Disconnected
Waiting for connection on channel 3

.pre

^^ serial client

.pre
root@rpi2:~# sdptool browse local | grep SP
root@rpi2:~# hcitool scan
Scanning ...
E0:2A:82:90:2D:7B nuc
root@rpi2:~# sdptool add --channel=3 SP
Serial Port service registered
root@rpi2:~# rfcomm connect /dev/rfcomm0 E0:2A:82:90:2D:7B 3
Connected /dev/rfcomm0 to E0:2A:82:90:2D:7B on channel 3
Press CTRL-C for hangup
.pre