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.

CC2650: BLE Observer+Peripheral Application

Part Number: CC2650

Hi,

I want create an application, which reads some data from nearby BLE tags in Observer mode and send this data to a central device in Peripheral mode.

I am using the example  peripheral_observer project to achieve this particular requirement. I was able to build the project and flashed in to cc2650 custom board.

Now I am getting connectable beacons from cc2650 custom board, which means peripheral is okay. But how can I trigger the observer functionality?

Appreciate the help.

  • Hi Danish,

    Did you read the readme file? github.com/.../simple_peripheral_observer.md You can start scanning by pressing the left key.
  • Thanks Marie for the response. Appreciate the effort.

    Yes I saw that document and read it.
    Upon Button press "GAPObserverRole_StartDiscovery" will be called and start discovering the nearby BLEs.

    My custom board doesn't have any button or any kind of user input mechanisms. In this scenario how can I initiate "GAPObserverRole_StartDiscovery" call?

    I already tried with a timer by calling "GAPObserverRole_StartDiscovery" call from timer handler, but its not working.
    Not working in the sense, I am not getting any hit under "GAP_DEVICE_INFO_EVENT" and there is plenty of BLE broadcasters at my work place.

    Help me find a way to call "GAPObserverRole_StartDiscovery" to initiate observer code without disturbing the overall code flow.
  • Hi Danish,

    A timer sounds like a goo idea. Are you sure GAPObserverRole_StartDiscovery() is called?
  • Hi Marie,

    Yes I did. I will try it again.

    static void scan_timer_callback(UArg arg)
    {
    GAPObserverRole_StartDiscovery(DEFAULT_DISCOVERY_MODE,
    DEFAULT_DISCOVERY_ACTIVE_SCAN,
    DEFAULT_DISCOVERY_WHITE_LIST);
    }

    This is my timer callback function.

    Can you suggest any alternatives.

    Thanks,
    Danish
  • Hi Danish,

    Can you enable active scan, and use a sniffer to see if your device is sending out scan request packets?
  • Hi Danish,

    Did you figure it out?

    I will close this thread due to inactivity.
  • Hi Marie,

    I haven't found the exact solution, that I was looking for.

    But I found that, calling "GAPObserverRole_StartDiscovery" from a different thread such as, a timer callback or a new task is doesn't seem to be working.

    Then I called the "GAPObserverRole_StartDiscovery" from the same thread and it is start working. Please see the code below.

          // If RTOS queue is not empty, process app message.
          while (!Queue_empty(appMsgQueue))
          {
            sbpEvt_t *pMsg = (sbpEvt_t *)Util_dequeueMsg(appMsgQueue);
            if (pMsg)
            {
              // Process message.
              SimpleBLEPeripheral_processAppMsg(pMsg);
    
    #ifndef DISCOVERY_TASK
              GAPObserverRole_StartDiscovery(DEFAULT_DISCOVERY_MODE,
                                            DEFAULT_DISCOVERY_ACTIVE_SCAN,
                                            DEFAULT_DISCOVERY_WHITE_LIST);
    #endif
              // Free the space from the message.
              ICall_free(pMsg);
            }
          }

    Not quite sure about the stability of this work around.

    PS: we don't have a sniffer setup at our work place to monitor the scanning as you mentioned in the previous responses. 

    Thanks and Regards,

    Danish

  • Hi Danish,

    The observer task is not designed for being called from any other task than the application task. However, a timer within this task should have no issue with calling GAPObserverRole_StartDiscovery().