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.

Do you have Peripheral + Broadcast or Observer + Broadcast solution in CC2650?

Other Parts Discussed in Thread: CC2650, BLE-STACK, CC2640

Do you have Peripheral + Broadcast  or  Observer + Broadcast  sample code in CC2650?

I need Beacon + Sensor function ,so must be Broadcast  and Receive data.

  • Hi Abel,
    The following Host combo roles are supported with the V2 BLE-Stack on CC2640:
    The possible combo roles and HOST_CONFIG defines are:
    Peirpheral + Observer : PERIPHERAL_CFG+OBSERVER_CFG
    Central + Broadcaster : CENTRAL_CFG+BROADCASTER_CFG
    Peripheral + Central : PERIPHERAL_CFG+CENTRAL_CFG
    Broadcaster + Observer : BROADCASTER_CFG+OBSERVER_CFG
    Please refer to the SW Developer's Guide for more information.

    Best wishes
  • Hi Quote:

    This only have config define . Have one project in two function with time task?

    Or must be Add new project by self. 

  • Have any update??

  • Hi Abel,

    please modify simpleBLEPeripheral.c and peripheral.c. I enable advertising after connection

    simpleBLEPeripheral.c

    if (events & SBP_PERIODIC_EVT)
    
       {
    
         events &= ~SBP_PERIODIC_EVT;
    
         uint8_t adv_enabled_status = TRUE;
    
         GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8_t), &adv_enabled_status);
    
         //Util_startClock(&periodicClock);
    
         // Perform periodic application task
    
         //SimpleBLEPeripheral_performPeriodicTask();
    
       }

    peripheral.c

    case GAPROLE_ADVERT_ENABLED:
    
         if (len == sizeof(uint8_t))
    
         {
    
           if ( (gapRole_state == GAPROLE_CONNECTED) || (gapRole_state == GAPROLE_CONNECTED_ADV) )
    
           {
    
             gapRole_AdvNonConnEnabled = TRUE;
    
             gapRole_AdvEnabled = *((uint8*)pValue);
    
             if ( (gapRole_state == GAPROLE_CONNECTED) && (gapRole_AdvEnabled == TRUE) )
    
             {
    
               // Turn on advertising
    
               gapRole_setEvent(START_ADVERTISING_EVT);
    
             }
    
             else if ( (gapRole_state == GAPROLE_CONNECTED_ADV) && (gapRole_AdvEnabled == FALSE) )  
    
             {
    
               // Turn off Advertising
    
               VOID GAP_EndDiscoverable(selfEntity);
    
             }
    
           }
    
           else {
    
           // Non-connectable advertising must be disabled.
    
           if (gapRole_AdvNonConnEnabled != TRUE)
    
           {
    
             uint8_t oldAdvEnabled = gapRole_AdvEnabled;
    
             gapRole_AdvEnabled = *((uint8_t*)pValue);
    
             if ((oldAdvEnabled) && (gapRole_AdvEnabled == FALSE))
    
             {
    
               // Turn off advertising.
    
               if ((gapRole_state == GAPROLE_ADVERTISING)
    
                   || (gapRole_state == GAPROLE_WAITING_AFTER_TIMEOUT))
    
               {
    
                 VOID GAP_EndDiscoverable(selfEntity);
    
               }
    
             }
    
             else if ((oldAdvEnabled == FALSE) && (gapRole_AdvEnabled))
    
             {
    
               // Turn on advertising.
    
               if ((gapRole_state == GAPROLE_STARTED)
    
                   || (gapRole_state == GAPROLE_WAITING)
    
                   || (gapRole_state == GAPROLE_WAITING_AFTER_TIMEOUT))
    
               {
    
                 gapRole_setEvent(START_ADVERTISING_EVT);
    
               }
    
             }
    
           }
    
           else
    
           {
    
             ret = bleIncorrectMode;
    
           }
    
           }
    
         }
    
         else
    
         {
    
           ret = bleInvalidRange;
    
         }
    
         break;

  • Thank you very much. I have try it.