/arthid

replace hid_sppd

Primary LanguageC

arthid 

Waitman Gobble <ns@waitman.net>


Note: Before installing update the Makefile with PREFIX, etc.


to build:

# make

to clean:

# make clean

to install:

# make install

to deinstall:

#make deinstall

to run:

arthid

This program will start a daemon process which opens L2cap socket connections on PSM 17 and 19




# btsockstat
Active raw HCI sockets
Socket   PCB      Flags  Recv-Q Send-Q Local address   
fffff8003ed612e8 fffff801b62ed580 000002      0      0 *               
Active L2CAP sockets
PCB      	     Recv-Q Send-Q Local address/PSM   Foreign address   CID   State
fffff80008bc5400      0      0 *                /19    *                 0     LISTEN
fffff801e299c900      0      0 *                /17    *                 0     LISTEN
fffff801b66f5600      0      0 *                /1     *                 0     LISTEN
fffff8000a207800      0      0 *                /3     *                 0     LISTEN
Active RFCOMM sessions
L2PCB    PCB      Flag MTU   Out-Q DLCs State
fffff8000a207800 fffff80008c9ed00 0    667   0     No   LISTEN


# sdpcontrol -l browse

Record Handle: 00000000
Service Class ID List:
        Service Discovery Server (0x1000)
Protocol Descriptor List:
        L2CAP (0x0100)
        SDP (0x0001)
Bluetooth Profile Descriptor List:
        Service Discovery Server (0x1000) ver. 1.0

Record Handle: 0x00000001
Service Class ID List:
        Browse Group Descriptor (0x1001)

Record Handle: 0x00000011
Service Class ID List:
        Human Interface Device (0x1124)
Protocol Descriptor List:
        L2CAP (0x0100)
Bluetooth Profile Descriptor List:
        Human Interface Device (0x1124) ver. 1.0



You can specify PID File, FIFO buffer file and keystroke delay.

Keystroke delay is specified in milliseconds.

# arthid -P /var/run/boo.pid -F /tmp/fifotmp -d 50




Some examples of sending characters to client:


# echo "222223333344444A" >> /tmp/fifotmp

# printf "22;222\t33 33\t44.444AabcdE\nEEeeeX " >> /tmp/fifotmp

single quotes

# printf '22;2 @XZ!&*()::_+ 22\t33 33\t44.444$$#^&*()AabcdE\nEEeeeX ' >> /tmp/fifotmp

Note that if you use 'printf' then add an extra trailing space.



To disconnect clients:

# pkill -HUP -F /var/run/boo.pid

To shut down the daemon:

# pkill -TERM -F /var/run/boo.pid



Example Log File:

Mar 22 09:58:54 afia arthid: Using PID File /var/run/boo.pid
Mar 22 09:58:54 afia arthid: Using FIFO Buffer /tmp/fifotmp
Mar 22 09:58:54 afia arthid: Setting Keystroke Delay 50000 microseconds
Mar 22 09:58:54 afia arthid: Starting
Mar 22 09:59:12 afia arthid: Client Connected 00:10:60:af:5b:af
Mar 22 09:59:42 afia arthid: HUP - Closing Client Connections
Mar 22 09:59:55 afia arthid: Client Connected 00:10:60:af:5b:af
Mar 22 10:01:13 afia arthid: Shutting Down