Adapter API - Devices property not updated if connection initiated by remote device
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.
Marcel Holtmann
maintainerHi Bea,
Quoted 6 lines
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.
Quoted 7 lines
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->deviceslist could be updated whenadapter_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
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
Quoted 23 lines · Marcel Holtmann
Hi Bea,
Quoted 6 lines
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.
Quoted 7 lines
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->deviceslist could be updated whenadapter_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
Marcel Holtmann
maintainerHi 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 ;)
Quoted 4 lines
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
Hi,
Quoted 8 lines · Marcel Holtmann
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
Luiz Augusto von Dentz
maintainerHi
Quoted 6 lines · Johan Hedberg
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.
Signature · 2 lines
Luiz Augusto von Dentz Engenheiro de Computação