Skip to content

Commit 0afb899

Browse files
authored
Merge pull request #2644 from tannewt/disable_ble_file_service
Disable BLE file service for now
2 parents 1e7ec1b + e8f7141 commit 0afb899

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

py/circuitpy_mpconfig.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,11 @@ CIRCUITPY_SERIAL_BLE = 0
328328
endif
329329
CFLAGS += -DCIRCUITPY_SERIAL_BLE=$(CIRCUITPY_SERIAL_BLE)
330330

331+
ifndef CIRCUITPY_BLE_FILE_SERVICE
332+
CIRCUITPY_BLE_FILE_SERVICE = 0
333+
endif
334+
CFLAGS += -DCIRCUITPY_BLE_FILE_SERVICE=$(CIRCUITPY_BLE_FILE_SERVICE)
335+
331336
# REPL over UART
332337
ifndef CIRCUITPY_SERIAL_UART
333338
CIRCUITPY_SERIAL_UART = 0

supervisor/shared/bluetooth.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ mp_obj_list_t characteristic_list;
6464
mp_obj_t characteristic_list_items[4];
6565

6666
void supervisor_bluetooth_start_advertising(void) {
67+
#if !CIRCUITPY_BLE_FILE_SERVICE
68+
return;
69+
#endif
6770
bool is_connected = common_hal_bleio_adapter_get_connected(&common_hal_bleio_adapter_obj);
6871
if (is_connected) {
6972
return;
@@ -79,6 +82,10 @@ void supervisor_bluetooth_start_advertising(void) {
7982
}
8083

8184
void supervisor_start_bluetooth(void) {
85+
#if !CIRCUITPY_BLE_FILE_SERVICE
86+
return;
87+
#endif
88+
8289
common_hal_bleio_adapter_set_enabled(&common_hal_bleio_adapter_obj, true);
8390

8491
supervisor_ble_service_uuid.base.type = &bleio_uuid_type;
@@ -203,6 +210,9 @@ uint32_t current_command[1024 / sizeof(uint32_t)];
203210
volatile size_t current_offset;
204211

205212
void supervisor_bluetooth_background(void) {
213+
#if !CIRCUITPY_BLE_FILE_SERVICE
214+
return;
215+
#endif
206216
if (!run_ble_background) {
207217
return;
208218
}
@@ -296,6 +306,9 @@ void supervisor_bluetooth_background(void) {
296306

297307
// This happens in an interrupt so we need to be quick.
298308
bool supervisor_bluetooth_hook(ble_evt_t *ble_evt) {
309+
#if !CIRCUITPY_BLE_FILE_SERVICE
310+
return false;
311+
#endif
299312
// Catch writes to filename or contents. Length is read-only.
300313

301314
bool done = false;

0 commit comments

Comments
 (0)