From: Barry Byford <31baz66@gmail.com>
To: Bluez mailing list <linux-bluetooth@vger.kernel.org>
Subject: Register HID Profile
Date: Wed, 17 Oct 2018 23:04:00 +0100 [thread overview]
Message-ID: <CAAu3APYGPE9Wtfn3aX1qDBk+E0YpXFBRa_WWRwvhhJrLabo9Eg@mail.gmail.com> (raw)
In-Reply-To: <CAAu3APZEbVricfhZr5jSuAc8wpp31=dxYA305qfG5T_2v=qXGQ@mail.gmail.com>
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])
parent reply other threads:[~2018-10-17 22:04 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <CAAu3APZEbVricfhZr5jSuAc8wpp31=dxYA305qfG5T_2v=qXGQ@mail.gmail.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAAu3APYGPE9Wtfn3aX1qDBk+E0YpXFBRa_WWRwvhhJrLabo9Eg@mail.gmail.com \
--to=31baz66@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).