RE: bt "server" how to configure requiring passkey from connecting clients

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

 



Thank you for the answer again.

I'm registering the agent with:
    dbus_connection_try_register_object_path(agent_conn, "/btpand_agent", &agent_table, NULL, &err);

    "org.bluez" "/org/bluez" "org.bluez.AgentManager1" "RegisterAgent" "o" "/btpand_agent" "s" "NoInputNoOutput"

    "org.bluez" "/org/bluez" "org.bluez.AgentManager1" "RequestDefaultAgent" "o" "/btpand_agent"

This goes without any error and I guess it is correct since the AuthorizeService method is called properly.

To be exact, I correct that the AuthorizeService method is not called at the time of pairing, but only when I request PAN profil activation on the mobile phone. But the RequestPasskey method is still never called.

Sure, I always unpair both sides before I test anything.

Any other ideas, please?

Libor

-----Original Message-----
From: Bastien Nocera [mailto:hadess@xxxxxxxxxx] 
Sent: Dienstag, 14. August 2018 14:26
To: Libor Peltan <lpeltan@xxxxxxxxxxxx>; linux-bluetooth@xxxxxxxxxxxxxxx
Subject: Re: bt "server" how to configure requiring passkey from connecting clients

On Tue, 2018-08-14 at 12:14 +0000, Libor Peltan wrote:
> Thanks Bastien for your brief, but leading answer.
> 
> Still, I feel like I'm missing something :(
> 
> I've read the links carefully. The "CHIP-bluetooth-speaker" uses 
> bluez-tools' bt-agent with parameters set so that it's using 
> NoInputNoOutput capabilitiy, but requiring Passkey at the same time.
> This is exactly what I want!
> 
> No having bluez-tools in my setup, I tried to make my own programmed 
> agent behave similarly, i.e. according to your hint, implement the 
> RequestPasskey method in my agent. However, this method is never 
> called! When pairing a phone, BlueZ only calls the AuthorizeService 
> method of my agent.
> 
> How can I force BlueZ  to call the RequestPasskey method of my agent?
> 
> I tried to analyze how bluez-tools do it, but I haven't find anything 
> in their code. They seem to simply work...

You will also need to register the agent, and make sure it's the default one (you'll probably want to disable whatever other one you have running).

You would probably only ever get AuthorizeService if the device is already paired. You would need to unpair it, and once paired, mark it as trusted so that AuthorizeService is not called and the service is authorised without any further prompts (or check that the device is paired in your AuthorizeService implementation).

HTH





[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