Using SD130 v2.0.1 on nRF51822, I would like to be able to change the advertisment interval after first connection.

My app is based on the HRS sample, with a modified avertising_init:

static void advertising_init_interval(uint32_t advertInterval)
{

static bool inited = false;

uint32_t err_code;

memset(&options, 0, sizeof(options));

if (!inited)
{
inited = true;
APP_ERROR_CHECK(err_code);
}
else
{
APP_ERROR_CHECK(err_code);
}
}


When receiving BLE_GAP_EVT_DISCONNECTED, I call avertising_init_interval with 200 units as parameters. Log is ok, no error happens, however when I measure the timing using oscilloscope, I get my initial interval (~320 ms) instead of the expected ~125 ms. What am I doing wrong?

edit retag reopen delete

### Closed as "question is not relevant or outdated" by Jonathan at 2017-10-30 14:33:18 +0100

I'm assuming you are calling advertising start after you change the interval? Are you actually doing fast advertising? Not slow? Since this is the interval you are changing.

( 2017-10-09 15:42:52 +0100 )editconvert to answer

Indeed, stopping advertising if applicable and then restarting in fast mode. Seems the thing to do, but wouldn't work. Might have missed something. But my specification has now changed so I no longer need to do it.

( 2017-10-10 18:20:57 +0100 )editconvert to answer

Ok. So should we close this?

( 2017-10-10 22:13:46 +0100 )editconvert to answer

Yes, you surely can, I didn't find an appropriate closing reason like "No longer useful" so I didn't close it.

( 2017-10-30 14:32:34 +0100 )editconvert to answer