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.

CC2640R2F: Multi-role Operation

Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2642R

Customer using the CC2640R2F and currently do peripheral and observer roles.  They see the multi_role.c example code and was wondering if this is for observer plus central or is it possible to run observer, peripheral and central roles concurrently?  Did not see the peripheral support in multi_role.c or multi.c. If it is not practical to do Central and Peripheral concurrently then would like to investigate how to make a decision at bootup to initialize as a central/observer or a peripheral/observer.

  • multi_role can run as BLE central and peripheral by default. If you want it to act as observer, you would need to enable scan all the time and it should be possible. By the way, the RAM/Flash of CC2640R2F might not be enough for such application and I would suggest you to consider using CC2642R instead of CC2640R2F.

  • Customer does not see anything related to Peripheral GAP role state changes in multi.c or multi_role.c.  They would expect to see something like this from the simple_peripheral_observer.c example code:

     

    /*********************************************************************

    * @fn      SimpleBLEPeripheral_processStateChangeEvt

    *

    * @brief   Process a pending GAP Role state change event.

    *

    * @param   newState - new state

    *

    * @return  None.

    */

    static void SimpleBLEPeripheral_processStateChangeEvt(gaprole_States_t newState)

    {

    #ifdef PLUS_BROADCASTER

      static bool firstConnFlag = false;

    #endif // PLUS_BROADCASTER

     

      switch ( newState )

      {

        case GAPROLE_STARTED:

          {

            uint8_t ownAddress[B_ADDR_LEN];

            uint8_t systemId[DEVINFO_SYSTEM_ID_LEN];

     

            GAPRole_GetParameter(GAPROLE_BD_ADDR, ownAddress);

    Suggestion?

  • Lawrence,

    I'm assuming that the customer is on SDK v3.40 and using blestack (not ble5stack).

    Answering your questions in order:

    1) The Multi-Role example supports Central + Peripheral by default. Some other role combinations are possible.

    2) The processing of the role-started event in Multi-Role example exists here:

    Application\multi_role.c:
    multi_role_processRoleEvent(pEvent) -> switch (pEvent->gap.opcode) -> case GAP_DEVICE_INIT_DONE_EVENT

    In contrast, the Simple Peripheral example, the processing is as follows:

    PROFILES\peripheral.c:
    gapRole_processGAPMsg(pMsg) -> switch (pMsg->opcode) -> case GAP_DEVICE_INIT_DONE_EVENT -> GAPROLE_STARTED

    ... which in turn is processed here:

    simple_peripheral.c
    SimplePeripheral_processStateChangeEvt(newState) -> switch ( newState ) -> case GAPROLE_STARTED

    I hope this answers the specific questions, but feel free to ask other questions here or in a new thread. 

    Please refer to the User's Guide section on GAPRole (typically found here: C:/ti/simplelink_cc2640r2_sdk_3_40_00_10/docs/blestack/ble_user_guide/html/ble-stack-3.x/gaprole.html)

    -Luis