2006-12-19 13:25:00

by Loreno Oliveira

[permalink] [raw]
Subject: [Bluez-users] notification of baseband conection establishment

Hi there,

does anybody know some facility for a called device to detect the
establishment of a baseband connection? That is, say we have two devices, A
and B, and A attempts a paging to B. The idea is fire an event in B as soon
as the baseband connection is established.

I thought two ideas for this: first, when the synchronous call to
"hci_create_connection" returns, A then invokes, via SDP, a service
advertised on B, which fires the event on that device (it is reasonable in
my context to assume that B advertises a service such like that). Second,
some application in B runs a thread that constantly monitors the
availability of baseband connections through "hci_for_each_dev function".
Such an application would maintain a data structure for controling existent
conections. When a new conection is established, B updates the data
structure and fires the event.

Well, I was wondering if there is a better solution for this problem.

PS: I am developing over the BlueZ code itself, and not over the utilities
hcitools, hciconfig....

Regards and thanks for any hint...

Loreno


Attachments:
(No filename) (1.06 kB)
(No filename) (1.13 kB)
(No filename) (347.00 B)
(No filename) (164.00 B)
Download all attachments

2006-12-19 13:32:22

by Pierre-Yves Paulus

[permalink] [raw]
Subject: Re: [Bluez-users] notification of baseband conection establishment

Hello Loreno,

> does anybody know some facility for a called device to detect the
> establishment of a baseband connection?

The DBus API already offers that:

Signals from the Adapter hierarchy (from dbus-api.txt):

void RemoteDeviceConnected(string address)
This signal will be send if a low level connection
between two devices has been created.

void RemoteDeviceDisconnected(string address)
This signal will be send if a low level connection
between two devices has been terminated.

Regards,
Pierre-Yves

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2006-12-19 13:28:54

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] notification of baseband conection establishment

Hi Loreno,

> does anybody know some facility for a called device to detect the
> establishment of a baseband connection? That is, say we have two
> devices, A and B, and A attempts a paging to B. The idea is fire an
> event in B as soon as the baseband connection is established.
>
> I thought two ideas for this: first, when the synchronous call to
> "hci_create_connection" returns, A then invokes, via SDP, a service
> advertised on B, which fires the event on that device (it is
> reasonable in my context to assume that B advertises a service such
> like that). Second, some application in B runs a thread that
> constantly monitors the availability of baseband connections through
> "hci_for_each_dev function". Such an application would maintain a data
> structure for controling existent conections. When a new conection is
> established, B updates the data structure and fires the event.

look at the D-Bus API for BlueZ. It sends you a signal once a device has
been connected or disconnected.

Regards

Marcel



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users