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.

Why delay discovery after link establishment?

In the simpleBleCentral project, in simpleBleCentral.c, when simpleBLECentralEventCB() receives the GAP_LINK_ESTABLISHED_EVENT, it doesn't call GATT_DiscPrimaryServiceByUUID() directly, but rather starts a one second timer to delay service discovery.  Is this logic and delay really required for discovery to work correctly?  It smells like a workaround for some timing issue or race condition.

TIA,

Richard

  • Hello,

    I don't have any data that it wouldn't work, but maybe it does insure all gap state variables are set to connected state. Even if this was required (I'm not sure it is), the timer could be set to a lower value, like 10ms. 

    BR,

    -Greg