From b6b2539c302edc1f4bb836e16d2cd29d7140f36d Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 16 Feb 2017 14:01:27 +0700 Subject: [PATCH] rename ADV Scan to ScanResp to avoid central scan activity --- .../Bluefruit52Lib/examples/beacon/beacon.ino | 2 +- .../examples/bleuart/bleuart.ino | 2 +- .../examples/blinky_ota/blinky_ota.ino | 2 +- .../examples/controller/controller.ino | 2 +- .../neopixel_picker/neopixel_picker.ino | 2 +- libraries/Bluefruit52Lib/src/bluefruit.cpp | 54 ++++++++++--------- libraries/Bluefruit52Lib/src/bluefruit.h | 24 ++++++--- 7 files changed, 51 insertions(+), 37 deletions(-) diff --git a/libraries/Bluefruit52Lib/examples/beacon/beacon.ino b/libraries/Bluefruit52Lib/examples/beacon/beacon.ino index dc33e578..d831842b 100644 --- a/libraries/Bluefruit52Lib/examples/beacon/beacon.ino +++ b/libraries/Bluefruit52Lib/examples/beacon/beacon.ino @@ -44,7 +44,7 @@ void setupAdv(void) // There is no room for Name in Advertising packet // Use Scan response for Name - Bluefruit.addScanName(); + Bluefruit.addScanRespName(); } void loop() diff --git a/libraries/Bluefruit52Lib/examples/bleuart/bleuart.ino b/libraries/Bluefruit52Lib/examples/bleuart/bleuart.ino index 668897a2..e2978779 100644 --- a/libraries/Bluefruit52Lib/examples/bleuart/bleuart.ino +++ b/libraries/Bluefruit52Lib/examples/bleuart/bleuart.ino @@ -72,7 +72,7 @@ void setupAdv(void) // There is no room for Name in Advertising packet // Use Scan response for Name - Bluefruit.addScanName(); + Bluefruit.addScanRespName(); } void loop() diff --git a/libraries/Bluefruit52Lib/examples/blinky_ota/blinky_ota.ino b/libraries/Bluefruit52Lib/examples/blinky_ota/blinky_ota.ino index 79c99af5..553d162e 100644 --- a/libraries/Bluefruit52Lib/examples/blinky_ota/blinky_ota.ino +++ b/libraries/Bluefruit52Lib/examples/blinky_ota/blinky_ota.ino @@ -38,7 +38,7 @@ void setupAdv(void) // There is no room for Name in Advertising packet // Use Scan response for Name - Bluefruit.addScanName(); + Bluefruit.addScanRespName(); } void loop() diff --git a/libraries/Bluefruit52Lib/examples/controller/controller.ino b/libraries/Bluefruit52Lib/examples/controller/controller.ino index 27cbef0a..9415568f 100644 --- a/libraries/Bluefruit52Lib/examples/controller/controller.ino +++ b/libraries/Bluefruit52Lib/examples/controller/controller.ino @@ -61,7 +61,7 @@ void setupAdv(void) // There is no room for Name in Advertising packet // Use Scan response for Name - Bluefruit.addScanName(); + Bluefruit.addScanRespName(); } /**************************************************************************/ diff --git a/libraries/Bluefruit52Lib/examples/neopixel_picker/neopixel_picker.ino b/libraries/Bluefruit52Lib/examples/neopixel_picker/neopixel_picker.ino index 8c35468b..64fb658f 100644 --- a/libraries/Bluefruit52Lib/examples/neopixel_picker/neopixel_picker.ino +++ b/libraries/Bluefruit52Lib/examples/neopixel_picker/neopixel_picker.ino @@ -76,7 +76,7 @@ void setupAdv(void) // There is no room for Name in Advertising packet // Use Scan response for Name - Bluefruit.addScanName(); + Bluefruit.addScanRespName(); } /**************************************************************************/ diff --git a/libraries/Bluefruit52Lib/src/bluefruit.cpp b/libraries/Bluefruit52Lib/src/bluefruit.cpp index e4d83c50..f9224bb6 100644 --- a/libraries/Bluefruit52Lib/src/bluefruit.cpp +++ b/libraries/Bluefruit52Lib/src/bluefruit.cpp @@ -101,36 +101,42 @@ static void bluefruit_blinky_cb( TimerHandle_t xTimer ) */ AdafruitBluefruit::AdafruitBluefruit(void) { - _ble_event_sem = NULL; + _max_prph_conn = 1; + _max_central_conn = 0; - _led_blink_th = NULL; - _led_conn = true; + _ble_event_sem = NULL; + + _led_blink_th = NULL; + _led_conn = true; varclr(&_adv); varclr(&_scan_resp); - _tx_power = 0; + _tx_power = 0; strcpy(_name, CFG_DEFAULT_NAME); _txbuf_sem = NULL; - _conn_hdl = BLE_GATT_HANDLE_INVALID; - _bonded = false; + _conn_hdl = BLE_GATT_HANDLE_INVALID; + _bonded = false; _chars_count = 0; for(uint8_t i=0; i