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.

bug in peripheral.c

In peripheral.c in gapRole_ProcessGAPMsg(), I found the code:

if ( gapRole_AdvEnabled)
{
// End advertising so we can restart advertising in order
// to change to connectable advertising from nonconnectable.
VOID GAP_EndDiscoverable( gapRole_TaskID );
}
else // Turn advertising back on.
{
gapRole_AdvEnabled = TRUE;
VOID osal_set_event( gapRole_TaskID, START_ADVERTISING_EVT);
}

If you disable advertising due to a connection event, the stack turns it back on. Volume 6 of the BLE core spec chapter 1.1 says it perfectly fine to go from a connected to state to a standby state. Why does the stack force us to advertise when a connection ends? 

  • Hi Peter,

    The peripheral.c is not part of the stack, it's merely an abstraction for the Application to manage connections (and GAP in general) easier. You are free to modify it as you will.

    Best Regards

    Joakim