Add option to wipe BLE bonds
This commit is contained in:
parent
a60ad3445e
commit
860fe3c005
@ -371,6 +371,12 @@ char bt_devname[11];
|
||||
#elif MCU_VARIANT == MCU_NRF52
|
||||
uint8_t eeprom_read(uint32_t mapped_addr);
|
||||
|
||||
void bt_bond_wipe() {
|
||||
// Delete all bonding data
|
||||
Bluefruit.Periph.clearBonds();
|
||||
led_indicate_info(2);
|
||||
}
|
||||
|
||||
void bt_stop() {
|
||||
if (bt_state != BT_STATE_OFF) {
|
||||
bt_allow_pairing = false;
|
||||
|
1
Input.h
1
Input.h
@ -22,6 +22,7 @@
|
||||
#define BUTTON_MIN_DURATION 50
|
||||
#define BUTTON_3S_DURATION 3000
|
||||
#define BUTTON_6S_DURATION 6000
|
||||
#define BUTTON_9S_DURATION 9000
|
||||
|
||||
#define EVENT_ALL 0x00
|
||||
#define EVENT_CLICKS 0x01
|
||||
|
@ -1489,7 +1489,9 @@ void process_serial() {
|
||||
#if HAS_INPUT
|
||||
void button_event(uint8_t event, unsigned long duration) {
|
||||
if (duration > BUTTON_MIN_DURATION) {
|
||||
if (duration > BUTTON_6S_DURATION) {
|
||||
if (duration > BUTTON_9S_DURATION) {
|
||||
bt_bond_wipe();
|
||||
} else if (duration > BUTTON_6S_DURATION) {
|
||||
bt_stop();
|
||||
bt_conf_save(false);
|
||||
} else if (duration > BUTTON_3S_DURATION) {
|
||||
|
Loading…
Reference in New Issue
Block a user