Do you have Peripheral + Broadcast or Observer + Broadcast sample code in CC2650?
I need Beacon + Sensor function ,so must be Broadcast and Receive data.
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.
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;