if (*slot_cnt < BTDM_MIN_SLEEP_DURATION) {
return false;
}
+ /* wake up 3 slots in advance */
+ *slot_cnt = *slot_cnt -3;
return true;
}
btdm_lpcycle_us_frac = RTC_CLK_CAL_FRACT;
btdm_lpcycle_us = 32 << btdm_lpcycle_us_frac;
+#if CONFIG_BTDM_MODEM_SLEEP_MODE_ORIG
bool select_src_ret = false;
bool set_div_ret = false;
-#if CONFIG_BTDM_MODEM_SLEEP_MODE_ORIG
#if CONFIG_BTDM_LPCLK_SEL_MAIN_XTAL
select_src_ret = btdm_lpclk_select_src(BTDM_LPCLK_SEL_XTAL);
set_div_ret = btdm_lpclk_set_div(rtc_clk_xtal_freq_get() * 32 - 1);
while(1) {
#if (CONFIG_GATTS_NOTIFY_THROUGHPUT)
vTaskDelay(2000 / portTICK_PERIOD_MS);
- uint32_t bit_rate = 0;
- if (start_time) {
- current_time = esp_timer_get_time();
- bit_rate = notify_len * SECOND_TO_USECOND / (current_time - start_time);
- ESP_LOGI(GATTC_TAG, "Notify Bit rate = %d Btye/s, = %d bit/s, time = %ds",
- bit_rate, bit_rate<<3, (int)((current_time - start_time) / SECOND_TO_USECOND));
- } else {
- ESP_LOGI(GATTC_TAG, "Notify Bit rate = 0 Btye/s, = 0 bit/s");
+ if(is_connecet){
+ uint32_t bit_rate = 0;
+ if (start_time) {
+ current_time = esp_timer_get_time();
+ bit_rate = notify_len * SECOND_TO_USECOND / (current_time - start_time);
+ ESP_LOGI(GATTC_TAG, "Notify Bit rate = %d Btye/s, = %d bit/s, time = %ds",
+ bit_rate, bit_rate<<3, (int)((current_time - start_time) / SECOND_TO_USECOND));
+ } else {
+ ESP_LOGI(GATTC_TAG, "Notify Bit rate = 0 Btye/s, = 0 bit/s");
+ }
}
#endif /* #if (CONFIG_GATTS_NOTIFY_THROUGHPUT) */
#if (CONFIG_GATTC_WRITE_THROUGHPUT)