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



xkbd-bthid : a software Bluetooth HID Keyboard

My Changes

  • allready defined in sdp_lib.h

    allready defined in sdp_lib.h
    
    • [DH] xkbd-0.8.15_bthid/src/sdp.c

  • use system libraries

    use system libraries
    
    • [DH] xkbd-0.8.15_bthid/src/makefile

  • install debian dependencies

    install debian dependencies
    
    • [DH] debian-build.sh

  • http://mulliner.org/bluetooth/xkbdbthid-0.1_src.tar.gz

    mulliner.org/bluetooth/xkbdbthid-0.1_src.tar.gz
    
    import source from archive
    
    • [DH] COPYING
    • [DH] Makefile
    • [DH] README
    • [DH] bthid/en_US.qwerty.xkbd
    • [DH] bthid/img/backspace.xpm
    • [DH] bthid/img/kbd.xpm
    • [DH] bthid/img/return.xpm
    • [DH] bthid/img/shift.xpm
    • [DH] bthid/img/tab.xpm
    • [DH] bthid/xkbdbthidwrapper/Makefile
    • [DH] bthid/xkbdbthidwrapper/xkbdbthid.sh
    • [DH] bthid/xkbdbthidwrapper/xkbdbthidwrapper.c
    • [DH] osso-xkbdbthid.desktop
    • [DH] xkbd-0.8.15_bthid/AUTHORS
    • [DH] xkbd-0.8.15_bthid/COPYING
    • [DH] xkbd-0.8.15_bthid/ChangeLog
    • [DH] xkbd-0.8.15_bthid/INSTALL
    • [DH] xkbd-0.8.15_bthid/Makefile.am
    • [DH] xkbd-0.8.15_bthid/Makefile.in
    • [DH] xkbd-0.8.15_bthid/NEWS
    • [DH] xkbd-0.8.15_bthid/README
    • [DH] xkbd-0.8.15_bthid/README.bthid
    • [DH] xkbd-0.8.15_bthid/aclocal.m4
    • [DH] xkbd-0.8.15_bthid/autom4te.cache/output.0
    • [DH] xkbd-0.8.15_bthid/autom4te.cache/requests
    • [DH] xkbd-0.8.15_bthid/autom4te.cache/traces.0
    • [DH] xkbd-0.8.15_bthid/config.guess
    • [DH] xkbd-0.8.15_bthid/config.h
    • [DH] xkbd-0.8.15_bthid/config.h.in
    • [DH] xkbd-0.8.15_bthid/config.sub
    • [DH] xkbd-0.8.15_bthid/configure
    • [DH] xkbd-0.8.15_bthid/configure.ac
    • [DH] xkbd-0.8.15_bthid/data/Makefile.am
    • [DH] xkbd-0.8.15_bthid/data/Makefile.in
    • [DH] xkbd-0.8.15_bthid/data/en_GB.qwerty.tabletpc.xkbd.in
    • [DH] xkbd-0.8.15_bthid/data/en_GB.qwerty.tiny.xkbd.in
    • [DH] xkbd-0.8.15_bthid/data/en_GB.qwerty.xkbd.in
    • [DH] xkbd-0.8.15_bthid/data/en_US.qwerty.xkbd.in
    • [DH] xkbd-0.8.15_bthid/data/en_all.fitaly.xkbd.in
    • [DH] xkbd-0.8.15_bthid/data/img/Makefile.am
    • [DH] xkbd-0.8.15_bthid/data/img/Makefile.in
    • [DH] xkbd-0.8.15_bthid/data/img/backspace.xpm
    • [DH] xkbd-0.8.15_bthid/data/img/kbd.xpm
    • [DH] xkbd-0.8.15_bthid/data/img/return.xpm
    • [DH] xkbd-0.8.15_bthid/data/img/shift.xpm
    • [DH] xkbd-0.8.15_bthid/data/img/tab.xpm
    • [DH] xkbd-0.8.15_bthid/data/kbdconfig.numsonly.in
    • [DH] xkbd-0.8.15_bthid/depcomp
    • [DH] xkbd-0.8.15_bthid/doc/Makefile.am
    • [DH] xkbd-0.8.15_bthid/doc/Makefile.in
    • [DH] xkbd-0.8.15_bthid/doc/docbook.dsl
    • [DH] xkbd-0.8.15_bthid/doc/style.css
    • [DH] xkbd-0.8.15_bthid/doc/xkbd.1.in
    • [DH] xkbd-0.8.15_bthid/install-sh
    • [DH] xkbd-0.8.15_bthid/ltmain.sh
    • [DH] xkbd-0.8.15_bthid/missing
    • [DH] xkbd-0.8.15_bthid/packaging/Makefile.am
    • [DH] xkbd-0.8.15_bthid/packaging/Makefile.in
    • [DH] xkbd-0.8.15_bthid/packaging/ipkg/90xXkbd
    • [DH] xkbd-0.8.15_bthid/packaging/ipkg/Makefile.am
    • [DH] xkbd-0.8.15_bthid/packaging/ipkg/Makefile.in
    • [DH] xkbd-0.8.15_bthid/packaging/ipkg/control.in
    • [DH] xkbd-0.8.15_bthid/packaging/ipkg/menu.in
    • [DH] xkbd-0.8.15_bthid/packaging/ipkg/postinst
    • [DH] xkbd-0.8.15_bthid/packaging/ipkg/postrm
    • [DH] xkbd-0.8.15_bthid/src/Makefile
    • [DH] xkbd-0.8.15_bthid/src/Makefile.am
    • [DH] xkbd-0.8.15_bthid/src/Makefile.in
    • [DH] xkbd-0.8.15_bthid/src/box.c
    • [DH] xkbd-0.8.15_bthid/src/box.h
    • [DH] xkbd-0.8.15_bthid/src/button.c
    • [DH] xkbd-0.8.15_bthid/src/button.h
    • [DH] xkbd-0.8.15_bthid/src/hid.h
    • [DH] xkbd-0.8.15_bthid/src/hidcd.c
    • [DH] xkbd-0.8.15_bthid/src/hidcd.h
    • [DH] xkbd-0.8.15_bthid/src/kb.c
    • [DH] xkbd-0.8.15_bthid/src/kb.h
    • [DH] xkbd-0.8.15_bthid/src/libXkbd.c
    • [DH] xkbd-0.8.15_bthid/src/libXkbd.h
    • [DH] xkbd-0.8.15_bthid/src/libvirtkeys.c
    • [DH] xkbd-0.8.15_bthid/src/libvirtkeys.h
    • [DH] xkbd-0.8.15_bthid/src/makefile
    • [DH] xkbd-0.8.15_bthid/src/sdp.c
    • [DH] xkbd-0.8.15_bthid/src/sdp.h
    • [DH] xkbd-0.8.15_bthid/src/structs.h
    • [DH] xkbd-0.8.15_bthid/src/xkbd.c
    • [DH] xkbd-0.8.15_bthid/xkbd.desktop
    • [DH] xkbd-0.8.15_bthid/xkbd.png




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