from this post link text i have again doubt
i define #define APP_ADV_TIMEOUT_IN_SECONDS 10. now my advertising stops after 10 sec.but i want to restart it again then??
from this post link text i have again doubt
i define #define APP_ADV_TIMEOUT_IN_SECONDS 10. now my advertising stops after 10 sec.but i want to restart it again then??
Hi, just add advertising start function call on idle event. See here below:
/* Function for handling advertising events. This function will be called for advertising events which are passed to the application */ static void on_adv_evt(ble_adv_evt_t ble_adv_evt) { ret_code_t err_code;
switch (ble_adv_evt)
{
case BLE_ADV_EVT_FAST:
{
/* do nothing */
break;
}
case BLE_ADV_EVT_IDLE:
{
/* start advertising again */
err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
APP_ERROR_CHECK(err_code);
break;
}
default:
break;
}
}
Feel free to have a look at my code repo on github for a full application example:
github.com/.../nrf51_led_dimmer
Regards.
Hi, just add advertising start function call on idle event. See here below:
/* Function for handling advertising events. This function will be called for advertising events which are passed to the application */ static void on_adv_evt(ble_adv_evt_t ble_adv_evt) { ret_code_t err_code;
switch (ble_adv_evt)
{
case BLE_ADV_EVT_FAST:
{
/* do nothing */
break;
}
case BLE_ADV_EVT_IDLE:
{
/* start advertising again */
err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
APP_ERROR_CHECK(err_code);
break;
}
default:
break;
}
}
Feel free to have a look at my code repo on github for a full application example:
github.com/.../nrf51_led_dimmer
Regards.
i can't understand solution. i want to make it in sleep mode and then advertise again
My proposed solution allows you to start again advertising after 10 s so the device will never stop to advertise. It doesn't go in sleep mode. Indeed as far as I know the device can not go in sleep mode and advertise at the same time.