Connection Callback - onConnectedCallback()


#1

I find it difficult to setup reliable connection management when the connection callback does not pass the mac address of the connected device. All I get is the connection handle and that is problematic if I have connection attempts to multiple devices. The connection-callback is not synchronous of coarse.

Am I missing how to reliably link a specific connection attempt with the handle returned?


#2

Hi @panda,

What did you observe to make the conclusion that the connections with multiple devices are not reliable? The address of the peer devices has been included in the scan callback.

Best regards,
Guohui


#3

The connection itself is reliable, but establishing a reliable means of connection management is not possible. For example, if you initiate 2 connections in rapid succession, the connection callback (which may return at unpredictable intervals and the order is not guaranteed) does not indicate which device has connected (or failed to connect as the case may be).

The scan callback is not synchronous to the connection process so I can’t see how to use that to match which device has connected.

This is only an issue in a scenario where you have to establish multiple connections rapidly to different devices which happens to be my use case.


#4

Hi @panda,

I get you. Since the connection callback is asynchronous, so you are not sure which device is connected in the connection callback if multiple connections is established rapidly. Thus you would like it to pass in the MAC address in the connection callback to identify the connected device.

Well, I have marked this post and will look into this feature in the next firmware update. Will post the update here when it is ready.

Best regards,
Guohui