Skip to content

Commit ed50f9e

Browse files
committed
v33 (re-enable advertising every 30 seconds)
1 parent 2f53c66 commit ed50f9e

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

main/main.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#define CA_PK "VnZ0epkCQ5PnguMMIxZCIqFvrTpmMxOve3iCYK2hKX4="
2-
#define FW_VER 32
2+
#define FW_VER 33
33
#define PRODUCT "VIRKEY"
44
#define LOG_TAG "MAIN"
55

@@ -246,6 +246,11 @@ static bool erase_on_reset;
246246
static uint32_t reset_button_tm;
247247
// --- End Reset button timer
248248

249+
// Advertising enable timer
250+
#define ADV_ENABLE_TIME 300 // 30 seconds
251+
static uint32_t adv_enable_tm;
252+
// --- End Advertising enable timer
253+
249254
// Function declarations
250255
static int reset_flash_config(bool);
251256
static esp_err_t save_flash_config();
@@ -1980,6 +1985,15 @@ void app_main(void) {
19801985
}
19811986
// --- End Reset Timer
19821987

1988+
// Advertising enable timer
1989+
if (adv_enable_tm > 0) {
1990+
adv_enable_tm --;
1991+
} else {
1992+
gatts_start_adv();
1993+
adv_enable_tm = ADV_ENABLE_TIME;
1994+
}
1995+
// --- End Advertising enable timer
1996+
19831997
xSemaphoreGive(session_sem);
19841998
}
19851999
}

0 commit comments

Comments
 (0)