I'm currently working on an application where a master has to connect to a slave.
The slave is advertising with undirected, connectable advertises.
At some point, the master application will ask for a connection to the slave.
Is there a possibility that the procedure does not succeed (maybe some packets during the validation are lost)?
I'm excluding the cases
- the slave request a disconnect
- after the connection procedure is completed, the slave goes out of range and therefore, the connection timeout trigger a disconnection.
Thank you
Hi Daniele,
What is the MCU that you are working on?
Is there a possibility that the procedure does not succeed (maybe some packets during the validation are lost)?
Yes, the slave could report a not established connection, because it never received the ack.
Are you able to connect the devices?
Regards,
Mario
Thank you for your answer Mario,
It's a KW36Z.
In the case of connection not established by slave, should i expect a response on the connection callback of type EvtDisconnect?
I usually have no problem connecting to slaves but i want to be able to consider all the possible outputs of a connection requests.
Hi Daniele,
Yes, For example, the code has a case Disconnect event
case gConnEvtDisconnected_c:
{
.
.
if (pConnectionEvent->eventData.disconnectedEvent.reason == gHciConnectionTimeout_c)
{
Regards,
Mario