This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Changing Ad Packs

Hi, I'm trying to change ad packets in the blinky example. I want to be able to keep blinking but change the ad packs (don't know if this make sense, but main goal is to change the ad packets) The example is here

I'm trying to use the function sd_ble_gap_adv_data_set to put my messages in p_data. I followed the set up with this

The following is my code... I think it is absolutely wrong and I'm not sure where to approach it from here. i tried putting the code at the bottom of the main.c file but it isn't compiling and I tried putting it in the middle and it wouldn't work either.

static uint32_t sd_ble_gap_adv_data_set(uint8_t type, data_t * p_advdata, data_t * p_typedata)
	

{
	
	
	(uint8_t const*p_data, uint8_t const * 	p_sr_data)


p_data [3] ={0x1e, 0xff, 0x00};



}
  • That code won't even compile, it's not even C.

    You're not supposed to try implementing sd_ble_gap_adv_data_set(), you're supposed to call it.

    void my_change_adv_data_method()
    {
        char adv_data[3] = { 0x1e, 0xff, 0x00 };
        sd_ble_gap_adv_data_set( adv_data, sizeof(adv_data), NULL, 0);
    }
    

    something more like that

  • @RK thank you for your response. do you know how to change ad packets by any chance?

  • It's the code I already posted