* Register HID Profile
[not found] <CAAu3APZEbVricfhZr5jSuAc8wpp31=dxYA305qfG5T_2v=qXGQ@mail.gmail.com>
@ 2018-10-17 22:04 ` Barry Byford
0 siblings, 0 replies; only message in thread
From: Barry Byford @ 2018-10-17 22:04 UTC (permalink / raw)
To: Bluez mailing list
Hello,
I am still experiencing difficulties registering a profile and getting
BlueZ to call the NewConnection method when a connection attempt is
made to it.
When I try to connect from another computer, it connects briefly
before disconnecting again.
I am starting the server with the input plugin removed using:
sudo /usr/lib/bluetooth/bluetoothd -P input
A btmon log of the session is available at:
https://drive.google.com/uc?authuser=0&id=1CgPcEtj1g3Um-1qBuQ8hEImKR28bVmnx&export=download
I have looked through the log but there is nothing in there that I am
understanding to be an indicator of the issue.
I have had some success if I set up the sockets to listen for
connections with the code below. However I still don't get the
NewConnection method called in the profile I have setup.
Any guidance would be greatly appreciated.
Thanks,
Barry
print('Waiting for connections')
self.scontrol = socket.socket(socket.AF_BLUETOOTH,
socket.SOCK_SEQPACKET,
socket.BTPROTO_L2CAP)
self.scontrol.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
self.sinterrupt = socket.socket(socket.AF_BLUETOOTH,
socket.SOCK_SEQPACKET,
socket.BTPROTO_L2CAP)
self.sinterrupt.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
# bind these sockets to a port
self.scontrol.bind((self.address, self.P_CTRL))
self.sinterrupt.bind((self.address, self.P_INTR ))
# Start listening on the server sockets
self.scontrol.listen(1) # Limit of 1 connection
self.sinterrupt.listen(1)
self.ccontrol, cinfo = self.scontrol.accept()
print('Got a connection on the control channel from ' + cinfo[0])
self.cinterrupt, cinfo = self.sinterrupt.accept()
print('Got a connection on the interrupt channel from ' + cinfo[0])
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-10-17 22:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CAAu3APZEbVricfhZr5jSuAc8wpp31=dxYA305qfG5T_2v=qXGQ@mail.gmail.com>
2018-10-17 22:04 ` Register HID Profile Barry Byford
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).