This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
The GAP_LINK_ESTABLISHED_EVENT provides the new connection handle value and indicates if it is for a Central or Peripheral connection so it's relatively easy to keep track of the handles for simultaneous central and peripheral connections. When the time comes to terminate a connection, how do you identify to the stack if the handle is for a Central connection or for a Peripheral connection?
It is not obvious to me when looking at the Multi Role example code. It appears to only manage central connections but I know it's possible to also terminate a connection as a peripheral.
Thanks.
Hi Michael,
the connection handle is, in the multirole example, stored in the array connHandleMap[connIdx]. To see how a connection is terminated, scroll down to multi_role_handleKeys():
//disconnect a connection case DISCONNECT: //disconnect GAPRole_TerminateConnection(connHandleMap[connIdx]); Display_print0(dispHandle, 0, 0, "Disconnecting"); break;