Skip to contentSkip to conversation

bluetooth-agent

DISCUSSION Germán Pedrosa 3 participants 8 messages Oct 28, 2009 – Oct 29, 2009 1 message not in the archive Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hi,

I am newbie with bluez and I'm developing a research project where I need to use various Bluetooth USB-dongles.

I need to deploy an automatic bluetooth pairing by command line (it is a project requirement), but the problem is that bluetooth-agent does only listen to hci0 device (I mean, if in any case I need to pair with any other dongle, bluetooth-agent does not reply).

Is there any possibility where bluetooth-agent could respond to the other devices? The man page for bluetooth-agent is missing, and I have not found any way to get it.

Thanks a lot and best regards.

#1 lore raw
Quoted 14 lines · Germán Pedrosa

Hi,

I am newbie with bluez and I'm developing a research project where I need to use various Bluetooth USB-dongles.

I need to deploy an automatic bluetooth pairing by command line (it is a project requirement), but the problem is that bluetooth-agent does only listen to hci0 device (I mean, if in any case I need to pair with any other dongle, bluetooth-agent does not reply).

Is there any possibility where bluetooth-agent could respond to the other devices? The man page for bluetooth-agent is missing, and I have not found any way to get it.

Quoted 9 lines

Thanks a lot and best regards.

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Hi German,

you can register the same bluetooth-agent to handle requests for all dongles.

See simple-agent code under test directory, there is an example how to register agent.
Basically you need to call:
adapter0.RegisterAgent(path, "DisplayYesNo") adapter1.RegisterAgent(path, "DisplayYesNo")
...

There isn't man pages for bluetooth-agent, see agent-api.txt under doc directory.

Cheers,
krau

#2 lore raw

Dear Claudio,

thanks for your quick answer.

But I'm not using BlueZ's API from a C program. We're using Java, so I'd like to run bluetooh-agent directly from the shell. Is there any way to handle requests for all dongles using the command line tool?

I tried using --path, but I didn't get any result. Probably because I'm not sure how the mapping between bluetooth and unix devices work.

Thanks in advance.

Best,

Quoted 12 lines · Claudio Takahasi

Hi German,

you can register the same bluetooth-agent to handle requests for all dongles.

See simple-agent code under test directory, there is an example how to register agent.
Basically you need to call:
adapter0.RegisterAgent(path, "DisplayYesNo") adapter1.RegisterAgent(path, "DisplayYesNo")
...

Quoted 5 lines

There isn't man pages for bluetooth-agent, see agent-api.txt under doc directory.

Cheers,
krau

On Wed, Oct 28, 2009 at 9:55 AM, Germán Pedrosa

Quoted 24 lines
Quoted 23 lines · <[email protected]> wrote:

Hi,

I am newbie with bluez and I'm developing a research project where I need to use various Bluetooth USB-dongles.

I need to deploy an automatic bluetooth pairing by command line (it is a project requirement), but the problem is that bluetooth-agent does only listen to hci0 device (I mean, if in any case I need to pair with any other dongle, bluetooth-agent does not reply).

Is there any possibility where bluetooth-agent could respond to the other devices? The man page for bluetooth-agent is missing, and I have not found any way to get it.

Thanks a lot and best regards.

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 1 line
Germán Pedrosa <[email protected]>
#4 lore raw
In reply to a message not in the archive

I agree with your point that use JNI would be better than run shell commands from Java code.

But here the scenario is totally different: in our architecture the Java components are not in charge to run such a kind of things; there are a set on bash scripts that run some previous deendencies of our system, such as bluetoth-agent.

Therefore I'd need to replicate the behaviour explained by Claudio before in this thread, but instead of calling the native api, invoking the command line tool.

Best regards,

Quoted 93 lines · LORENZO ANTONIO BRITO MORALES

im very shure, but the library from java dont support a lot of commands...
Im developing a system based in bluez , i think is better to code somethings in c, then use
JINI to use C in java.. i think it will be easier for you doing in this way, than using a command line from java.

Quoted 65 lines · Germán Pedrosa

Dear Claudio,

thanks for your quick answer.

But I'm not using BlueZ's API from a C program. We're using Java, so I'd
like to run bluetooh-agent directly from the shell. Is there any way to
handle requests for all dongles using the command line tool?

I tried using --path, but I didn't get any result. Probably because I'm
not sure how the mapping between bluetooth and unix devices work.

Thanks in advance.

Best,

Quoted 14 lines · Claudio Takahasi

Hi German,

you can register the same bluetooth-agent to handle requests for all dongles.

See simple-agent code under test directory, there is an example how to
register agent.
Basically you need to call:
adapter0.RegisterAgent(path, "DisplayYesNo") adapter1.RegisterAgent(path, "DisplayYesNo")
...

Quoted 6 lines

There isn't man pages for bluetooth-agent, see agent-api.txt under doc
directory.

Cheers,
krau

On Wed, Oct 28, 2009 at 9:55 AM, Germán Pedrosa

Quoted 23 lines
Quoted 22 lines · <[email protected]> wrote:

Hi,

I am newbie with bluez and I'm developing a research project where I need to use various Bluetooth USB-dongles.

I need to deploy an automatic bluetooth pairing by command line (it is a
project requirement), but the problem is that bluetooth-agent does only
listen to hci0 device (I mean, if in any case I need to pair with any
other dongle, bluetooth-agent does not reply).

Is there any possibility where bluetooth-agent could respond to the other devices? The man page for bluetooth-agent is missing, and I have
not found any way to get it.

Thanks a lot and best regards.

Quoted 14 lines
Quoted 6 lines
Quoted 6 lines

--
To unsubscribe from this list: send the line "unsubscribe linux- bluetooth" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 7 lines
Germán Pedrosa <[email protected]>

--
To unsubscribe from this list: send the line "unsubscribe linux- 
bluetooth" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

LORENZO ANTONIO BRITO MORALES
[email protected]
lorbrito.blogspot.com

#5 lore raw

Hi German,

Quoted 7 lines · Germán Pedrosa

I agree with your point that use JNI would be better than run shell commands from Java code.

But here the scenario is totally different: in our architecture the Java components are not in charge to run such a kind of things; there are a set on bash scripts that run some previous deendencies of our system, such as bluetoth-agent.

Are you refering to /test/agent program ?

Can you register an agent per adapter ? just run ./adapter --agent "hciX" 0000 for every 'X' adapter.

Or you can use the python script simple-agent for every adapter by running ./simple-agent hciX

Hope this helps.

Cheers,
Alok.

Quoted 108 lines

Therefore I'd need to replicate the behaviour explained by Claudio before in this thread, but instead of calling the native api, invoking the command line tool.

Best regards,

Quoted 89 lines · LORENZO ANTONIO BRITO MORALES

im very shure, but the library from java dont support a lot of commands...
Im developing a system based in bluez , i think is better to code somethings in c, then use
JINI to use C in java.. i think it will be easier for you doing in this way, than using a command line from java.

Quoted 71 lines · Germán Pedrosa

Dear Claudio,

thanks for your quick answer.

But I'm not using BlueZ's API from a C program. We're using Java, so I'd
like to run bluetooh-agent directly from the shell. Is there any way to
handle requests for all dongles using the command line tool?

I tried using --path, but I didn't get any result. Probably because I'm
not sure how the mapping between bluetooth and unix devices work.

Thanks in advance.

Best,

Quoted 14 lines · Claudio Takahasi

Hi German,

you can register the same bluetooth-agent to handle requests for all dongles.

See simple-agent code under test directory, there is an example how to
register agent.
Basically you need to call:
adapter0.RegisterAgent(path, "DisplayYesNo") adapter1.RegisterAgent(path, "DisplayYesNo")
...

Quoted 6 lines

There isn't man pages for bluetooth-agent, see agent-api.txt under doc
directory.

Cheers,
krau

On Wed, Oct 28, 2009 at 9:55 AM, Germán Pedrosa

Quoted 23 lines
Quoted 22 lines · <[email protected]> wrote:

Hi,

I am newbie with bluez and I'm developing a research project where I need to use various Bluetooth USB-dongles.

I need to deploy an automatic bluetooth pairing by command line (it is a
project requirement), but the problem is that bluetooth-agent does only
listen to hci0 device (I mean, if in any case I need to pair with any
other dongle, bluetooth-agent does not reply).

Is there any possibility where bluetooth-agent could respond to the other devices? The man page for bluetooth-agent is missing, and I have
not found any way to get it.

Thanks a lot and best regards.

Quoted 6 lines
Quoted 6 lines

--
To unsubscribe from this list: send the line "unsubscribe linux- bluetooth" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Quoted 8 lines

--
Germán Pedrosa <[email protected]>

--
To unsubscribe from this list: send the line "unsubscribe linux- bluetooth" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Quoted 4 lines

LORENZO ANTONIO BRITO MORALES
[email protected]
lorbrito.blogspot.com

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

#6 lore raw

Hi Alok,

Finally I decided to modify the python script, in order to add the PinCode as a parameter.

Thank you very much.

Quoted 133 lines · alok barsode

Hi German,

Quoted 7 lines · Germán Pedrosa

I agree with your point that use JNI would be better than run shell commands from Java code.

But here the scenario is totally different: in our architecture the Java components are not in charge to run such a kind of things; there are a set on bash scripts that run some previous deendencies of our system, such as bluetoth-agent.

Are you refering to /test/agent program ?

Can you register an agent per adapter ? just run ./adapter --agent "hciX" 0000 for every 'X' adapter.

Or you can use the python script simple-agent for every adapter by running ./simple-agent hciX

Hope this helps.

Cheers,
Alok.

Quoted 108 lines

Therefore I'd need to replicate the behaviour explained by Claudio before in this thread, but instead of calling the native api, invoking the command line tool.

Best regards,

Quoted 89 lines · LORENZO ANTONIO BRITO MORALES

im very shure, but the library from java dont support a lot of commands...
Im developing a system based in bluez , i think is better to code somethings in c, then use
JINI to use C in java.. i think it will be easier for you doing in this way, than using a command line from java.

Quoted 71 lines · Germán Pedrosa

Dear Claudio,

thanks for your quick answer.

But I'm not using BlueZ's API from a C program. We're using Java, so I'd
like to run bluetooh-agent directly from the shell. Is there any way to
handle requests for all dongles using the command line tool?

I tried using --path, but I didn't get any result. Probably because I'm
not sure how the mapping between bluetooth and unix devices work.

Thanks in advance.

Best,

Quoted 14 lines · Claudio Takahasi

Hi German,

you can register the same bluetooth-agent to handle requests for all dongles.

See simple-agent code under test directory, there is an example how to
register agent.
Basically you need to call:
adapter0.RegisterAgent(path, "DisplayYesNo") adapter1.RegisterAgent(path, "DisplayYesNo")
...

Quoted 6 lines

There isn't man pages for bluetooth-agent, see agent-api.txt under doc
directory.

Cheers,
krau

On Wed, Oct 28, 2009 at 9:55 AM, Germán Pedrosa

Quoted 23 lines
Quoted 22 lines · <[email protected]> wrote:

Hi,

I am newbie with bluez and I'm developing a research project where I need to use various Bluetooth USB-dongles.

I need to deploy an automatic bluetooth pairing by command line (it is a
project requirement), but the problem is that bluetooth-agent does only
listen to hci0 device (I mean, if in any case I need to pair with any
other dongle, bluetooth-agent does not reply).

Is there any possibility where bluetooth-agent could respond to the other devices? The man page for bluetooth-agent is missing, and I have
not found any way to get it.

Thanks a lot and best regards.

Quoted 6 lines
Quoted 6 lines

--
To unsubscribe from this list: send the line "unsubscribe linux- bluetooth" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Quoted 8 lines

--
Germán Pedrosa <[email protected]>

--
To unsubscribe from this list: send the line "unsubscribe linux- bluetooth" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Quoted 4 lines

LORENZO ANTONIO BRITO MORALES
[email protected]
lorbrito.blogspot.com

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw

Hi German,

Quoted 4 lines · Germán Pedrosa

Hi Alok,

Finally I decided to modify the python script, in order to add the PinCode as a parameter.

Why did u have to modify it? it prompts you for one during authentication. If u want to hardcode it, use test/agent program instead.

Quoted 3 lines

Thank you very much.

Cheers,
Alok.

Quoted 136 lines · alok barsode
Quoted 133 lines

Hi German,

Quoted 7 lines · Germán Pedrosa

I agree with your point that use JNI would be better than run shell commands from Java code.

But here the scenario is totally different: in our architecture the Java components are not in charge to run such a kind of things; there are a set on bash scripts that run some previous deendencies of our system, such as bluetoth-agent.

Are you refering to  /test/agent program ?

Can you register an agent per adapter ? just run ./adapter --agent "hciX" 0000 for every 'X' adapter.

Or you can use the python script simple-agent for every adapter  by running ./simple-agent hciX

Hope this helps.

Cheers,
Alok.

Quoted 108 lines

Therefore I'd need to replicate the behaviour explained by Claudio before in this thread, but instead of calling the native api, invoking the command line tool.

Best regards,

Quoted 89 lines · LORENZO ANTONIO BRITO MORALES

im very shure, but the library from java dont support a lot of commands...
Im developing a system based in bluez , i think is better to code somethings in c, then use
JINI to use C in java.. i think it will be easier for you doing in this way, than using a command line from java.

Quoted 71 lines · Germán Pedrosa

Dear Claudio,

thanks for your quick answer.

But I'm not using BlueZ's API from a C program. We're using Java, so I'd
like to run bluetooh-agent directly from the shell. Is there any way to
handle requests for all dongles using the command line tool?

I tried using --path, but I didn't get any result. Probably because I'm
not sure how the mapping between bluetooth and unix devices work.

Thanks in advance.

Best,

Quoted 14 lines · Claudio Takahasi

Hi German,

you can register the same bluetooth-agent to handle requests for all dongles.

See simple-agent code under test directory, there is an example how to
register agent.
Basically you need to call:
adapter0.RegisterAgent(path, "DisplayYesNo") adapter1.RegisterAgent(path, "DisplayYesNo")
...

Quoted 6 lines

There isn't man pages for bluetooth-agent, see agent-api.txt under doc
directory.

Cheers,
krau

On Wed, Oct 28, 2009 at 9:55 AM, Germán Pedrosa

Quoted 23 lines
Quoted 22 lines · <[email protected]> wrote:

Hi,

I am newbie with bluez and I'm developing a research project where I need to use various Bluetooth USB-dongles.

I need to deploy an automatic bluetooth pairing by command line (it is a
project requirement), but the problem is that bluetooth-agent does only
listen to hci0 device (I mean, if in any case I need to pair with any
other dongle, bluetooth-agent does not reply).

Is there any possibility where bluetooth-agent could respond to the other devices? The man page for bluetooth-agent is missing, and I have
not found any way to get it.

Thanks a lot and best regards.

Quoted 6 lines
Quoted 6 lines

--
To unsubscribe from this list: send the line "unsubscribe linux- bluetooth" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Quoted 8 lines

--
Germán Pedrosa <[email protected]>

--
To unsubscribe from this list: send the line "unsubscribe linux- bluetooth" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Quoted 4 lines

LORENZO ANTONIO BRITO MORALES
[email protected]
lorbrito.blogspot.com

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

#8 lore raw

Hi Alok,

Quoted 2 lines · you
Quoted 2 lines

Can you register an agent per adapter ? just run ./adapter --agent

Quoted 1 line

"hciX" 0000 for every 'X' adapter.

I didn't find the adapter program (I know, I've just seen that it is a mistake, it is the agent program), so I decided to modify the Python script.

This solution should be better, I'll try it.

Thanks a lot.

Quoted 154 lines · alok barsode

Hi German,

Quoted 4 lines · Germán Pedrosa

Hi Alok,

Finally I decided to modify the python script, in order to add the PinCode as a parameter.

Why did u have to modify it? it prompts you for one during authentication. If u want to hardcode it, use test/agent program instead.

Quoted 3 lines

Thank you very much.

Cheers,
Alok.

Quoted 136 lines · alok barsode
Quoted 133 lines

Hi German,

Quoted 7 lines · Germán Pedrosa

I agree with your point that use JNI would be better than run shell commands from Java code.

But here the scenario is totally different: in our architecture the Java components are not in charge to run such a kind of things; there are a set on bash scripts that run some previous deendencies of our system, such as bluetoth-agent.

Are you refering to /test/agent program ?

Can you register an agent per adapter ? just run ./adapter --agent "hciX" 0000 for every 'X' adapter.

Or you can use the python script simple-agent for every adapter by running ./simple-agent hciX

Hope this helps.

Cheers,
Alok.

Quoted 108 lines

Therefore I'd need to replicate the behaviour explained by Claudio before in this thread, but instead of calling the native api, invoking the command line tool.

Best regards,

Quoted 89 lines · LORENZO ANTONIO BRITO MORALES

im very shure, but the library from java dont support a lot of commands...
Im developing a system based in bluez , i think is better to code somethings in c, then use
JINI to use C in java.. i think it will be easier for you doing in this way, than using a command line from java.

Quoted 71 lines · Germán Pedrosa

Dear Claudio,

thanks for your quick answer.

But I'm not using BlueZ's API from a C program. We're using Java, so I'd
like to run bluetooh-agent directly from the shell. Is there any way to
handle requests for all dongles using the command line tool?

I tried using --path, but I didn't get any result. Probably because I'm
not sure how the mapping between bluetooth and unix devices work.

Thanks in advance.

Best,

Quoted 14 lines · Claudio Takahasi

Hi German,

you can register the same bluetooth-agent to handle requests for all dongles.

See simple-agent code under test directory, there is an example how to
register agent.
Basically you need to call:
adapter0.RegisterAgent(path, "DisplayYesNo") adapter1.RegisterAgent(path, "DisplayYesNo")
...

Quoted 6 lines

There isn't man pages for bluetooth-agent, see agent-api.txt under doc
directory.

Cheers,
krau

On Wed, Oct 28, 2009 at 9:55 AM, Germán Pedrosa

Quoted 23 lines
Quoted 22 lines · <[email protected]> wrote:

Hi,

I am newbie with bluez and I'm developing a research project where I need to use various Bluetooth USB-dongles.

I need to deploy an automatic bluetooth pairing by command line (it is a
project requirement), but the problem is that bluetooth-agent does only
listen to hci0 device (I mean, if in any case I need to pair with any
other dongle, bluetooth-agent does not reply).

Is there any possibility where bluetooth-agent could respond to the other devices? The man page for bluetooth-agent is missing, and I have
not found any way to get it.

Thanks a lot and best regards.

Quoted 6 lines
Quoted 6 lines

--
To unsubscribe from this list: send the line "unsubscribe linux- bluetooth" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Quoted 8 lines

--
Germán Pedrosa <[email protected]>

--
To unsubscribe from this list: send the line "unsubscribe linux- bluetooth" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Quoted 4 lines

LORENZO ANTONIO BRITO MORALES
[email protected]
lorbrito.blogspot.com

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html