Linux bluetooth development
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: "Montague, Jay" <jmontague@tycoint.com>
Cc: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: Re: bluez bluetooth problem
Date: Fri, 9 Sep 2016 13:42:47 +0300	[thread overview]
Message-ID: <20160909104247.GA11006@t440s.lan> (raw)
In-Reply-To: <9F3DE92910DE1D4697DD7D6F2FB4FDDC25A15990@003FCH1MPN5-071.003f.mgd2.msft.net>

Hi Jay,

On Wed, Sep 07, 2016, Montague, Jay wrote:
> I have tried to send commands using the Eclipse IDE but when I send the following:
> 
> system("echo -e 'agent NoInputNoOutput\n | bluetoothctl");
> 
> On the Edison it reports "No agent is registered" and the following message:

bluetoothctl *is* the agent, and since I assume it exits after piping
the command to it, it's not really a surprise that bluetoothd says there
is no agent.

> #!/bin/sh
> rfkill unblock bluetooth
> sdptool add -channel=22 SP
> sleep 1
> bluetoothctl << EOF
> agent NoInputNoOutput
> EOF
> sleep 1
> 
> Again it just report "No agent is registered".

As I said earlier, that's because bluetoothd presumably exited. It needs
to run in order for an agent to exist.

Regarding sdptool & rfcomm usage, you might want to look into using the
profile API instead (see doc/profile-api.txt and test/test-profile).
It'll take care of the SDP and RFCOMM details for you, and e.g.
completely skip TTYs in favor of RFCOMM sockets (I see you reported that
you had some kernel issues with the TTYs).

Johan

  reply	other threads:[~2016-09-09 10:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-07 15:05 bluez bluetooth problem Montague, Jay
2016-09-09 10:42 ` Johan Hedberg [this message]
2016-09-09 15:14   ` Montague, Jay
2016-09-09 15:27     ` Barry Byford
2016-09-09 15:33       ` Montague, Jay
  -- strict thread matches above, loose matches on Subject: below --
2016-09-09 10:19 Montague, Jay

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=20160909104247.GA11006@t440s.lan \
    --to=johan.hedberg@gmail.com \
    --cc=jmontague@tycoint.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