Merge pull request #2644 from tannewt/disable_ble_file_service

Disable BLE file service for now
This commit is contained in:
Dan Halbert 2020-02-20 15:57:38 -05:00 committed by GitHub
commit 0afb8991fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions

View File

@ -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

View File

@ -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;