public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* Adapter API - Devices property not updated if connection initiated by remote device
@ 2008-12-11  3:57 Bea Lam
  2008-12-12  1:43 ` Marcel Holtmann
  0 siblings, 1 reply; 6+ messages in thread
From: Bea Lam @ 2008-12-11  3:57 UTC (permalink / raw)
  To: linux-bluetooth

When using the org.bluez.Adapter interface, if I initiate a connection to a 
remote device, then the adapter's Devices property is updated to include the 
remote device, as expected. However, if the remote device initiates the 
connection to my device instead, it isn't added to the Devices list. This 
would appear to be a bug.

This can be problematic if I am trying to identify whether any remote devices 
are currently connected to the local adapter; it is not possible to identify 
the connected devices if they have initiated the connection.

It would be much appreciated if someone could look into this. Perhaps the 
adapter->devices list could be updated when adapter_add_active_conn() is 
called, but I'm not sure if this is correct.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Adapter API - Devices property not updated if connection initiated by remote device
  2008-12-11  3:57 Adapter API - Devices property not updated if connection initiated by remote device Bea Lam
@ 2008-12-12  1:43 ` Marcel Holtmann
  2008-12-12  4:52   ` Bea Lam
  0 siblings, 1 reply; 6+ messages in thread
From: Marcel Holtmann @ 2008-12-12  1:43 UTC (permalink / raw)
  To: Bea Lam; +Cc: linux-bluetooth

Hi Bea,

> When using the org.bluez.Adapter interface, if I initiate a connection to a 
> remote device, then the adapter's Devices property is updated to include the 
> remote device, as expected. However, if the remote device initiates the 
> connection to my device instead, it isn't added to the Devices list. This 
> would appear to be a bug.
> 
> This can be problematic if I am trying to identify whether any remote devices 
> are currently connected to the local adapter; it is not possible to identify 
> the connected devices if they have initiated the connection.
> 
> It would be much appreciated if someone could look into this. Perhaps the 
> adapter->devices list could be updated when adapter_add_active_conn() is 
> called, but I'm not sure if this is correct.

I know that Johan fixed a bug where FindDevice would not give any result
for temporary devices. So you can use FindDevice to get the device
object. Adding it to the device list? I am not sure about that.

Regards

Marcel



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Adapter API - Devices property not updated if connection initiated by remote device
  2008-12-12  1:43 ` Marcel Holtmann
@ 2008-12-12  4:52   ` Bea Lam
  2008-12-12 10:58     ` Marcel Holtmann
  0 siblings, 1 reply; 6+ messages in thread
From: Bea Lam @ 2008-12-12  4:52 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: linux-bluetooth

Hi Marcel,

Yes, FindDevice() is useful when I need to check whether a particular device 
is connected at the moment. But what if I don't know the address of the 
connecting device? That is, should BlueZ also be able to tell me when some 
random, unknown device connects to me?

thanks

Bea


On Friday 12 December 2008 11:43:17 am Marcel Holtmann wrote:
> Hi Bea,
>
> > When using the org.bluez.Adapter interface, if I initiate a connection to
> > a remote device, then the adapter's Devices property is updated to
> > include the remote device, as expected. However, if the remote device
> > initiates the connection to my device instead, it isn't added to the
> > Devices list. This would appear to be a bug.
> >
> > This can be problematic if I am trying to identify whether any remote
> > devices are currently connected to the local adapter; it is not possible
> > to identify the connected devices if they have initiated the connection.
> >
> > It would be much appreciated if someone could look into this. Perhaps the
> > adapter->devices list could be updated when adapter_add_active_conn() is
> > called, but I'm not sure if this is correct.
>
> I know that Johan fixed a bug where FindDevice would not give any result
> for temporary devices. So you can use FindDevice to get the device
> object. Adding it to the device list? I am not sure about that.
>
> Regards
>
> Marcel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Adapter API - Devices property not updated if connection initiated by remote device
  2008-12-12  4:52   ` Bea Lam
@ 2008-12-12 10:58     ` Marcel Holtmann
  2008-12-12 13:28       ` Johan Hedberg
  0 siblings, 1 reply; 6+ messages in thread
From: Marcel Holtmann @ 2008-12-12 10:58 UTC (permalink / raw)
  To: Bea Lam; +Cc: linux-bluetooth

Hi Bea,

can you please stop top-posting. Like every other open source mailing
list we are using bottom-posting and you are just destroying the flow of
the replies with top-posting. And KMail is perfectly capable of doing
so ;)

> Yes, FindDevice() is useful when I need to check whether a particular device 
> is connected at the moment. But what if I don't know the address of the 
> connecting device? That is, should BlueZ also be able to tell me when some 
> random, unknown device connects to me?

I think we do create a temporary device structure for incoming
connections in all cases since that is needed for pairing. However we
might not add this to the Devices list.

Johan, any comments here. Should we just send out signals? I think the
current reason for not doing so is that in most cases this is during a
pairing event and we do wanna wait until it succeeds. However I don't
see the big harm in adding it to the list.

Regards

Marcel



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Adapter API - Devices property not updated if connection initiated by remote device
  2008-12-12 10:58     ` Marcel Holtmann
@ 2008-12-12 13:28       ` Johan Hedberg
  2008-12-13  1:02         ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 6+ messages in thread
From: Johan Hedberg @ 2008-12-12 13:28 UTC (permalink / raw)
  To: linux-bluetooth

Hi,

On Fri, Dec 12, 2008, Marcel Holtmann wrote:
> I think we do create a temporary device structure for incoming
> connections in all cases since that is needed for pairing. However we
> might not add this to the Devices list.
> 
> Johan, any comments here. Should we just send out signals? I think the
> current reason for not doing so is that in most cases this is during a
> pairing event and we do wanna wait until it succeeds. However I don't
> see the big harm in adding it to the list.

There definitely needs to be a way to know that a remote device has
connected to us even if it is not paired. I think we should just
populate the Devices list in this case and then remove the device from
it once it disconnects (if it didn't pair before that) and also send all
appropriate signals while doing this. For knowing if the device is
paired or not we already have the separate Paired property.

Johna

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Adapter API - Devices property not updated if connection initiated by remote device
  2008-12-12 13:28       ` Johan Hedberg
@ 2008-12-13  1:02         ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 6+ messages in thread
From: Luiz Augusto von Dentz @ 2008-12-13  1:02 UTC (permalink / raw)
  To: Johan Hedberg; +Cc: linux-bluetooth

Hi

On Fri, Dec 12, 2008 at 10:28 AM, Johan Hedberg <johan.hedberg@nokia.com> wrote:
> There definitely needs to be a way to know that a remote device has
> connected to us even if it is not paired. I think we should just
> populate the Devices list in this case and then remove the device from
> it once it disconnects (if it didn't pair before that) and also send all
> appropriate signals while doing this. For knowing if the device is
> paired or not we already have the separate Paired property.

We could create the device object, but we should be careful to not
start a service discovery and end up with this device on the storage.
Note that this can be a security problem, since normally connections
should at least trigger authorization which requires the object
anyway, so someone is not really asking to the agent to authorize a
incoming connection.


-- 
Luiz Augusto von Dentz
Engenheiro de Computação

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-12-13  1:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-11  3:57 Adapter API - Devices property not updated if connection initiated by remote device Bea Lam
2008-12-12  1:43 ` Marcel Holtmann
2008-12-12  4:52   ` Bea Lam
2008-12-12 10:58     ` Marcel Holtmann
2008-12-12 13:28       ` Johan Hedberg
2008-12-13  1:02         ` Luiz Augusto von Dentz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox