diff options
| author | Dan Halbert <halbert@adafruit.com> | 2020-02-20 15:57:38 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-20 15:57:38 -0500 |
| commit | 0afb8991fa05ef2074b2af13d0fee8f2cb515f01 (patch) | |
| tree | bd32f75dffc3c590ee5c75e163f5c49a1a290623 | |
| parent | 1e7ec1b9529bf05a00613beb72bdd2dadb82a9db (diff) | |
| parent | e8f71415644846ca0f4195afcad4a9e8b2469ded (diff) | |
Merge pull request #2644 from tannewt/disable_ble_file_service
Disable BLE file service for now
| -rw-r--r-- | py/circuitpy_mpconfig.mk | 5 | ||||
| -rw-r--r-- | supervisor/shared/bluetooth.c | 13 |
2 files changed, 18 insertions, 0 deletions
diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 93e5982d5..d6e033daf 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -328,6 +328,11 @@ CIRCUITPY_SERIAL_BLE = 0 endif CFLAGS += -DCIRCUITPY_SERIAL_BLE=$(CIRCUITPY_SERIAL_BLE) +ifndef CIRCUITPY_BLE_FILE_SERVICE +CIRCUITPY_BLE_FILE_SERVICE = 0 +endif +CFLAGS += -DCIRCUITPY_BLE_FILE_SERVICE=$(CIRCUITPY_BLE_FILE_SERVICE) + # REPL over UART ifndef CIRCUITPY_SERIAL_UART CIRCUITPY_SERIAL_UART = 0 diff --git a/supervisor/shared/bluetooth.c b/supervisor/shared/bluetooth.c index 18caa2eb4..b463160cf 100644 --- a/supervisor/shared/bluetooth.c +++ b/supervisor/shared/bluetooth.c @@ -64,6 +64,9 @@ mp_obj_list_t characteristic_list; mp_obj_t characteristic_list_items[4]; void supervisor_bluetooth_start_advertising(void) { + #if !CIRCUITPY_BLE_FILE_SERVICE + return; + #endif bool is_connected = common_hal_bleio_adapter_get_connected(&common_hal_bleio_adapter_obj); if (is_connected) { return; @@ -79,6 +82,10 @@ void supervisor_bluetooth_start_advertising(void) { } void supervisor_start_bluetooth(void) { + #if !CIRCUITPY_BLE_FILE_SERVICE + return; + #endif + common_hal_bleio_adapter_set_enabled(&common_hal_bleio_adapter_obj, true); supervisor_ble_service_uuid.base.type = &bleio_uuid_type; @@ -203,6 +210,9 @@ uint32_t current_command[1024 / sizeof(uint32_t)]; volatile size_t current_offset; void supervisor_bluetooth_background(void) { + #if !CIRCUITPY_BLE_FILE_SERVICE + return; + #endif if (!run_ble_background) { return; } @@ -296,6 +306,9 @@ void supervisor_bluetooth_background(void) { // This happens in an interrupt so we need to be quick. bool supervisor_bluetooth_hook(ble_evt_t *ble_evt) { + #if !CIRCUITPY_BLE_FILE_SERVICE + return false; + #endif // Catch writes to filename or contents. Length is read-only. bool done = false; |
