|
|
|
@ -7,6 +7,7 @@
|
|
|
|
|
static bool ble_state_connected = false;
|
|
|
|
|
static bool ble_state_initialized = false;
|
|
|
|
|
static bool ble_advertising_wanted = false;
|
|
|
|
|
static bool ble_advertising_wh_wanted = false;
|
|
|
|
|
static bool ble_advertising = false;
|
|
|
|
|
|
|
|
|
|
bool ble_connected(void) {
|
|
|
|
@ -18,7 +19,7 @@ void set_connected(bool connected) { ble_state_connected = connected; }
|
|
|
|
|
void set_advertising(bool advertising) {
|
|
|
|
|
if (ble_advertising_wanted != advertising) {
|
|
|
|
|
if (ble_advertising_wanted) {
|
|
|
|
|
send_advertising_on();
|
|
|
|
|
send_advertising_on(ble_advertising_wh_wanted);
|
|
|
|
|
} else {
|
|
|
|
|
send_advertising_off();
|
|
|
|
|
}
|
|
|
|
@ -32,11 +33,12 @@ bool ble_initialized(void) {
|
|
|
|
|
return ble_state_initialized && ble_firmware_running();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void start_advertising(void) {
|
|
|
|
|
void start_advertising(bool whitelist) {
|
|
|
|
|
ble_advertising_wh_wanted = whitelist;
|
|
|
|
|
ble_advertising_wanted = true;
|
|
|
|
|
if (!ble_advertising) {
|
|
|
|
|
send_advertising_on();
|
|
|
|
|
}
|
|
|
|
|
//if (!ble_advertising) {
|
|
|
|
|
send_advertising_on(whitelist);
|
|
|
|
|
//}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void stop_advertising(void) {
|
|
|
|
|