Part Number: CC2541DK-MINI
Hello,
developing on simplebleperipheral app, i noticed that the function
GAPRole_SetParameter( GAPROLE_ADVERT_OFF_TIME, sizeof( uint16 ), &gapRole_AdvertOffTime );
actually doesnt stop advertising. So i used GAP_SetParamValue(TGAP_LIM_ADV_TIMEOUT, 10), in the init routine, to stop the packets after 10 seconds. Again, i noticed this one works only if i DONT make to update advertising during init phase and maintain the declaration
static uint8 advertData[] =
{
// Flags; this sets the device to use limited discoverable
// mode (advertises for 30 seconds at a time) instead of general
// discoverable mode (advertises indefinitely)
0x02, // length of this data
GAP_ADTYPE_FLAGS,
DEFAULT_DISCOVERABLE_MODE | GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED,
// service UUID, to notify central devices what services are included
// in this peripheral
0x03, // length of this data
GAP_ADTYPE_16BIT_MORE, // some of the UUID's, but not all
LO_UINT16( SIMPLEPROFILE_SERV_UUID ),
HI_UINT16( SIMPLEPROFILE_SERV_UUID ),
};
in this way my first two advertising packets, on power up, arent useful, they contain only static data. Can i solve this and still able to stop advertising after a fixed time?