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.

RTOS/CC2650STK: SimpleBLEObserver_processRoleEvent(...), what makes it work?

Part Number: CC2650STK

Tool/software: TI-RTOS

Hi, I'm trying to make the CC2650STK acts in Observer Role. I've edited the Board_keys.c file taken in the Simple_Observer example in order to use all the discovery functions of the simple_observer.c example. Everytime i press the Right Key the discovery starts properly but nothing else: I've noticed that in order to print the devices found, the scanning value must be FALSE, and this is made in the SimpleBLEObserver_processRoleEvent(...) function, as you can see here:

static void SimpleBLEObserver_processRoleEvent(gapObserverRoleEvent_t *pEvent)
{
  switch ( pEvent->gap.opcode )
  {
    case GAP_DEVICE_INIT_DONE_EVENT:  

......
......
......
case GAP_DEVICE_DISCOVERY_EVENT:
      {
        // discovery complete
        scanning = FALSE;

        // Copy results
        scanRes = pEvent->discCmpl.numDevs;
        memcpy(devList, pEvent->discCmpl.pDevList,
               (sizeof(gapDevRec_t) * pEvent->discCmpl.numDevs));
......
......

I've seen that this function is called in the SimpleBLEObserver_processStackMsg(...) function and that the last one is linked to the SBO_STATE_CHANGE_EVT. My question is: when does this state change? what triggers this event? Should I edit something else in order to make my CC2650STK acts in the observer role?
Thank you so much.