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.

WEBENCH® Tools/CC2540: CC2540 As Broadcaster advertising name Issue

Part Number: CC2540
Other Parts Discussed in Thread: BLE-STACK

Tool/software: WEBENCH® Design Tools

Hi, 

I am using cc2540. I want non connect able ble advertisement when i set these settings ble show name "N/A". How can i make ble advertise with correct name?

void SimpleBLEBroadcaster_Init( uint8 task_id )

{
simpleBLEBroadcaster_TaskID = task_id;

// Setup the GAP Broadcaster Role Profile
{
/*
#if defined( CC2540_MINIDK )
// For the CC2540DK-MINI keyfob, device doesn't start advertising until button is pressed
uint8 initial_advertising_enable = FALSE;
#else
// For other hardware platforms, device starts advertising upon initialization
uint8 initial_advertising_enable = TRUE;
#endif
*/
uint8 initial_advertising_enable = TRUE;

// By setting this to zero, the device will go into the waiting state after
// being discoverable for 30.72 second, and will not being advertising again
// until the enabler is set back to TRUE
uint16 gapRole_AdvertOffTime = 0;

uint8 advType = GAP_ADTYPE_ADV_NONCONN_IND; // use non-connectable advertisements
//uint8 advType = GAP_ADTYPE_ADV_SCAN_IND; // use scannable unidirected advertisements

// Set the GAP Role Parameters
GAPRole_SetParameter( GAPROLE_ADVERT_ENABLED, sizeof( uint8 ), &initial_advertising_enable );
// GAPRole_SetParameter( GAPROLE_ADVERT_OFF_TIME, sizeof( uint16 ), &gapRole_AdvertOffTime );

GAPRole_SetParameter( GAPROLE_SCAN_RSP_DATA, sizeof ( scanRspData ), scanRspData );
GAPRole_SetParameter( GAPROLE_ADVERT_DATA, sizeof( advertData ), advertData );

GAPRole_SetParameter( GAPROLE_ADV_EVENT_TYPE, sizeof( uint8 ), &advType );
}

// Set advertising interval
{
uint16 advInt = DEFAULT_ADVERTISING_INTERVAL;

GAP_SetParamValue( TGAP_LIM_DISC_ADV_INT_MIN, advInt );
GAP_SetParamValue( TGAP_LIM_DISC_ADV_INT_MAX, advInt );
GAP_SetParamValue( TGAP_GEN_DISC_ADV_INT_MIN, advInt );
GAP_SetParamValue( TGAP_GEN_DISC_ADV_INT_MAX, advInt );
}

  • Hi Muqarrab,

    What version of the BLE-Stack are you using?

    Since you are not advertising scannable you should not set the GAPROLE_SCAN_RSP_DATA parameter.

    I would also check the return status of the other function calls (GAPRole_SetParameter() and GAP_SetParamValue()).