RE: bluez bluetooth problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Johan,

When I manually enter the command "agent NoInputNoOutput" in bluetoothctl it works and registers the agent to be used for when pairing to a Bluetooth device. But when I try the same command in code it doesn't register it like I described originally, and it doesn't exit bluetoothctl either. It also doesn't work with other commands like "discoverable on" etc.

But I guess ill look into using the API profile instead. You didn't attach any documents so I guess these are available on github or something.

Jay

-----Original Message-----
From: Johan Hedberg [mailto:johan.hedberg@xxxxxxxxx]
Sent: 09 September 2016 11:43
To: Montague, Jay <jmontague@xxxxxxxxxxx>
Cc: linux-bluetooth@xxxxxxxxxxxxxxx
Subject: Re: bluez bluetooth problem

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

________________________________

This e-mail contains privileged and confidential information intended for the use of the addressees named above. If you are not the intended recipient of this e-mail, you are hereby notified that you must not disseminate, copy or take any action in respect of any information contained in it. If you have received this e-mail in error, please notify the sender immediately by e-mail and immediately destroy this e-mail and its attachments.
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux