This page will try to document my long‑living dream of having bluetooth software keyboard HID
 serial port and other stuff
• https://wiki.archlinux.org/index.php/bluetooth 

Contents: [Dobrica Pavlinušić's random unstructured stuff]
• Dobrica Pavlinušić's random unstructured stuff (xkbd‑bthid : a software Bluetooth HID Keyboard) 
• Dobrica Pavlinušić's random unstructured stuff (My Changes) 
• Dobrica Pavlinušić's random unstructured stuff (serial SP) 
• Dobrica Pavlinušić's random unstructured stuff (modify systemd script) 
• Dobrica Pavlinušić's random unstructured stuff (bring up device and make it discoverable) 
• Dobrica Pavlinušić's random unstructured stuff (serial server) 
• Dobrica Pavlinušić's random unstructured stuff (serial client) 

xkbd‑bthid : a software Bluetooth HID Keyboard
• http://mulliner.org/bluetooth/xkbdbthid.php 
My Changes
git.rot13.org Git ‑ xkbdbthid.git/rss log git.rot13.org Git ‑ xkbdbthid.git/rss log 
• allready defined in sdp_lib.h 
• use system libraries 
• install debian dependencies 
• http://mulliner.org/bluetooth/xkbdbthid‑0.1_src.tar.gz 

                                                  
serial SP
modify systemd script
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

bring up device and make it discoverable
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

serial server
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

serial client
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