From a2779b09a1ec8a50a50c06ff272b77abbfae3618 Mon Sep 17 00:00:00 2001 From: Todd Treece Date: Thu, 9 Mar 2017 09:40:43 -0500 Subject: [PATCH 1/3] merge examples into one folder --- .gitignore | 3 ++ .../adafruit_placeholder.h | 42 ------------------- .../library.properties | 9 ---- .../Hardware/SerialEcho/SerialEcho.ino | 0 .../examples}/Hardware/adc/adc.ino | 0 .../examples}/Hardware/adc_vbat/adc_vbat.ino | 0 .../examples}/Hardware/blinky/blinky.ino | 0 .../examples}/Hardware/hwinfo/hwinfo.ino | 0 .../examples}/Hardware/meminfo/meminfo.ino | 0 .../Hardware/nfc_to_gpio/nfc_to_gpio.ino | 0 .../{ => Peripheral}/beacon/beacon.ino | 0 .../{ => Peripheral}/blemidi/blemidi.ino | 0 .../blemidi_callback/blemidi_callback.ino | 0 .../{ => Peripheral}/bleuart/bleuart.ino | 0 .../blinky_ota/blinky_ota.ino | 0 .../clearbonds/clearbonds.ino | 0 .../controller/controller.ino | 0 .../controller/packetParser.cpp | 0 .../custom_hrm/custom_hrm.ino | 0 .../hid_keyboard/hid_keyboard.ino | 0 .../{ => Peripheral}/hid_mouse/hid_mouse.ino | 0 .../neopixel_picker/neopixel_picker.ino | 0 .../neopixel_picker/packetParser.cpp | 0 .../throughput/throughput.ino | 0 24 files changed, 3 insertions(+), 51 deletions(-) delete mode 100755 libraries/AdafruitFeather52Examples/adafruit_placeholder.h delete mode 100644 libraries/AdafruitFeather52Examples/library.properties rename libraries/{AdafruitFeather52Examples => Bluefruit52Lib/examples}/Hardware/SerialEcho/SerialEcho.ino (100%) rename libraries/{AdafruitFeather52Examples => Bluefruit52Lib/examples}/Hardware/adc/adc.ino (100%) rename libraries/{AdafruitFeather52Examples => Bluefruit52Lib/examples}/Hardware/adc_vbat/adc_vbat.ino (100%) rename libraries/{AdafruitFeather52Examples => Bluefruit52Lib/examples}/Hardware/blinky/blinky.ino (100%) rename libraries/{AdafruitFeather52Examples => Bluefruit52Lib/examples}/Hardware/hwinfo/hwinfo.ino (100%) rename libraries/{AdafruitFeather52Examples => Bluefruit52Lib/examples}/Hardware/meminfo/meminfo.ino (100%) rename libraries/{AdafruitFeather52Examples => Bluefruit52Lib/examples}/Hardware/nfc_to_gpio/nfc_to_gpio.ino (100%) rename libraries/Bluefruit52Lib/examples/{ => Peripheral}/beacon/beacon.ino (100%) rename libraries/Bluefruit52Lib/examples/{ => Peripheral}/blemidi/blemidi.ino (100%) rename libraries/Bluefruit52Lib/examples/{ => Peripheral}/blemidi_callback/blemidi_callback.ino (100%) rename libraries/Bluefruit52Lib/examples/{ => Peripheral}/bleuart/bleuart.ino (100%) rename libraries/Bluefruit52Lib/examples/{ => Peripheral}/blinky_ota/blinky_ota.ino (100%) rename libraries/Bluefruit52Lib/examples/{ => Peripheral}/clearbonds/clearbonds.ino (100%) rename libraries/Bluefruit52Lib/examples/{ => Peripheral}/controller/controller.ino (100%) rename libraries/Bluefruit52Lib/examples/{ => Peripheral}/controller/packetParser.cpp (100%) rename libraries/Bluefruit52Lib/examples/{ => Peripheral}/custom_hrm/custom_hrm.ino (100%) rename libraries/Bluefruit52Lib/examples/{ => Peripheral}/hid_keyboard/hid_keyboard.ino (100%) rename libraries/Bluefruit52Lib/examples/{ => Peripheral}/hid_mouse/hid_mouse.ino (100%) rename libraries/Bluefruit52Lib/examples/{ => Peripheral}/neopixel_picker/neopixel_picker.ino (100%) rename libraries/Bluefruit52Lib/examples/{ => Peripheral}/neopixel_picker/packetParser.cpp (100%) rename libraries/Bluefruit52Lib/examples/{ => Peripheral}/throughput/throughput.ino (100%) diff --git a/.gitignore b/.gitignore index b13f2b6f..e6b60a17 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,6 @@ /tools/nrfutil-0.5.2/dist/ /tools/nrfutil-0.5.2/nrfutil.egg-info/ /tools/.idea/ + +.DS_Store +*.swp diff --git a/libraries/AdafruitFeather52Examples/adafruit_placeholder.h b/libraries/AdafruitFeather52Examples/adafruit_placeholder.h deleted file mode 100755 index f76d9a0e..00000000 --- a/libraries/AdafruitFeather52Examples/adafruit_placeholder.h +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************/ -/*! - @file adafruit_placeholder.h - @author ktown - - @section LICENSE - - Software License Agreement (BSD License) - - Copyright (c) 2016, Adafruit Industries (adafruit.com) - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. Neither the name of the copyright holders nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/**************************************************************************/ - -#ifndef _ADAFRUIT_PLACEHOLDER_H_ -#define _ADAFRUIT_PLACEHOLDER_H_ - -// This file is required to make the examples show up in the Arduino IDE - -#endif /* _ADAFRUIT_PLACEHOLDER_H_ */ diff --git a/libraries/AdafruitFeather52Examples/library.properties b/libraries/AdafruitFeather52Examples/library.properties deleted file mode 100644 index 25133437..00000000 --- a/libraries/AdafruitFeather52Examples/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=Adafruit Feather52 Examples -version=0.1.0 -author=Adafruit -maintainer=Adafruit -sentence=Adafruit Bluefruit52 HW Examples -paragraph=Collection of hardware examples for Bluefruit Feather52 Board -category=Communication -url=http://www.adafruit.com/ -architectures=nRF52 diff --git a/libraries/AdafruitFeather52Examples/Hardware/SerialEcho/SerialEcho.ino b/libraries/Bluefruit52Lib/examples/Hardware/SerialEcho/SerialEcho.ino similarity index 100% rename from libraries/AdafruitFeather52Examples/Hardware/SerialEcho/SerialEcho.ino rename to libraries/Bluefruit52Lib/examples/Hardware/SerialEcho/SerialEcho.ino diff --git a/libraries/AdafruitFeather52Examples/Hardware/adc/adc.ino b/libraries/Bluefruit52Lib/examples/Hardware/adc/adc.ino similarity index 100% rename from libraries/AdafruitFeather52Examples/Hardware/adc/adc.ino rename to libraries/Bluefruit52Lib/examples/Hardware/adc/adc.ino diff --git a/libraries/AdafruitFeather52Examples/Hardware/adc_vbat/adc_vbat.ino b/libraries/Bluefruit52Lib/examples/Hardware/adc_vbat/adc_vbat.ino similarity index 100% rename from libraries/AdafruitFeather52Examples/Hardware/adc_vbat/adc_vbat.ino rename to libraries/Bluefruit52Lib/examples/Hardware/adc_vbat/adc_vbat.ino diff --git a/libraries/AdafruitFeather52Examples/Hardware/blinky/blinky.ino b/libraries/Bluefruit52Lib/examples/Hardware/blinky/blinky.ino similarity index 100% rename from libraries/AdafruitFeather52Examples/Hardware/blinky/blinky.ino rename to libraries/Bluefruit52Lib/examples/Hardware/blinky/blinky.ino diff --git a/libraries/AdafruitFeather52Examples/Hardware/hwinfo/hwinfo.ino b/libraries/Bluefruit52Lib/examples/Hardware/hwinfo/hwinfo.ino similarity index 100% rename from libraries/AdafruitFeather52Examples/Hardware/hwinfo/hwinfo.ino rename to libraries/Bluefruit52Lib/examples/Hardware/hwinfo/hwinfo.ino diff --git a/libraries/AdafruitFeather52Examples/Hardware/meminfo/meminfo.ino b/libraries/Bluefruit52Lib/examples/Hardware/meminfo/meminfo.ino similarity index 100% rename from libraries/AdafruitFeather52Examples/Hardware/meminfo/meminfo.ino rename to libraries/Bluefruit52Lib/examples/Hardware/meminfo/meminfo.ino diff --git a/libraries/AdafruitFeather52Examples/Hardware/nfc_to_gpio/nfc_to_gpio.ino b/libraries/Bluefruit52Lib/examples/Hardware/nfc_to_gpio/nfc_to_gpio.ino similarity index 100% rename from libraries/AdafruitFeather52Examples/Hardware/nfc_to_gpio/nfc_to_gpio.ino rename to libraries/Bluefruit52Lib/examples/Hardware/nfc_to_gpio/nfc_to_gpio.ino diff --git a/libraries/Bluefruit52Lib/examples/beacon/beacon.ino b/libraries/Bluefruit52Lib/examples/Peripheral/beacon/beacon.ino similarity index 100% rename from libraries/Bluefruit52Lib/examples/beacon/beacon.ino rename to libraries/Bluefruit52Lib/examples/Peripheral/beacon/beacon.ino diff --git a/libraries/Bluefruit52Lib/examples/blemidi/blemidi.ino b/libraries/Bluefruit52Lib/examples/Peripheral/blemidi/blemidi.ino similarity index 100% rename from libraries/Bluefruit52Lib/examples/blemidi/blemidi.ino rename to libraries/Bluefruit52Lib/examples/Peripheral/blemidi/blemidi.ino diff --git a/libraries/Bluefruit52Lib/examples/blemidi_callback/blemidi_callback.ino b/libraries/Bluefruit52Lib/examples/Peripheral/blemidi_callback/blemidi_callback.ino similarity index 100% rename from libraries/Bluefruit52Lib/examples/blemidi_callback/blemidi_callback.ino rename to libraries/Bluefruit52Lib/examples/Peripheral/blemidi_callback/blemidi_callback.ino diff --git a/libraries/Bluefruit52Lib/examples/bleuart/bleuart.ino b/libraries/Bluefruit52Lib/examples/Peripheral/bleuart/bleuart.ino similarity index 100% rename from libraries/Bluefruit52Lib/examples/bleuart/bleuart.ino rename to libraries/Bluefruit52Lib/examples/Peripheral/bleuart/bleuart.ino diff --git a/libraries/Bluefruit52Lib/examples/blinky_ota/blinky_ota.ino b/libraries/Bluefruit52Lib/examples/Peripheral/blinky_ota/blinky_ota.ino similarity index 100% rename from libraries/Bluefruit52Lib/examples/blinky_ota/blinky_ota.ino rename to libraries/Bluefruit52Lib/examples/Peripheral/blinky_ota/blinky_ota.ino diff --git a/libraries/Bluefruit52Lib/examples/clearbonds/clearbonds.ino b/libraries/Bluefruit52Lib/examples/Peripheral/clearbonds/clearbonds.ino similarity index 100% rename from libraries/Bluefruit52Lib/examples/clearbonds/clearbonds.ino rename to libraries/Bluefruit52Lib/examples/Peripheral/clearbonds/clearbonds.ino diff --git a/libraries/Bluefruit52Lib/examples/controller/controller.ino b/libraries/Bluefruit52Lib/examples/Peripheral/controller/controller.ino similarity index 100% rename from libraries/Bluefruit52Lib/examples/controller/controller.ino rename to libraries/Bluefruit52Lib/examples/Peripheral/controller/controller.ino diff --git a/libraries/Bluefruit52Lib/examples/controller/packetParser.cpp b/libraries/Bluefruit52Lib/examples/Peripheral/controller/packetParser.cpp similarity index 100% rename from libraries/Bluefruit52Lib/examples/controller/packetParser.cpp rename to libraries/Bluefruit52Lib/examples/Peripheral/controller/packetParser.cpp diff --git a/libraries/Bluefruit52Lib/examples/custom_hrm/custom_hrm.ino b/libraries/Bluefruit52Lib/examples/Peripheral/custom_hrm/custom_hrm.ino similarity index 100% rename from libraries/Bluefruit52Lib/examples/custom_hrm/custom_hrm.ino rename to libraries/Bluefruit52Lib/examples/Peripheral/custom_hrm/custom_hrm.ino diff --git a/libraries/Bluefruit52Lib/examples/hid_keyboard/hid_keyboard.ino b/libraries/Bluefruit52Lib/examples/Peripheral/hid_keyboard/hid_keyboard.ino similarity index 100% rename from libraries/Bluefruit52Lib/examples/hid_keyboard/hid_keyboard.ino rename to libraries/Bluefruit52Lib/examples/Peripheral/hid_keyboard/hid_keyboard.ino diff --git a/libraries/Bluefruit52Lib/examples/hid_mouse/hid_mouse.ino b/libraries/Bluefruit52Lib/examples/Peripheral/hid_mouse/hid_mouse.ino similarity index 100% rename from libraries/Bluefruit52Lib/examples/hid_mouse/hid_mouse.ino rename to libraries/Bluefruit52Lib/examples/Peripheral/hid_mouse/hid_mouse.ino diff --git a/libraries/Bluefruit52Lib/examples/neopixel_picker/neopixel_picker.ino b/libraries/Bluefruit52Lib/examples/Peripheral/neopixel_picker/neopixel_picker.ino similarity index 100% rename from libraries/Bluefruit52Lib/examples/neopixel_picker/neopixel_picker.ino rename to libraries/Bluefruit52Lib/examples/Peripheral/neopixel_picker/neopixel_picker.ino diff --git a/libraries/Bluefruit52Lib/examples/neopixel_picker/packetParser.cpp b/libraries/Bluefruit52Lib/examples/Peripheral/neopixel_picker/packetParser.cpp similarity index 100% rename from libraries/Bluefruit52Lib/examples/neopixel_picker/packetParser.cpp rename to libraries/Bluefruit52Lib/examples/Peripheral/neopixel_picker/packetParser.cpp diff --git a/libraries/Bluefruit52Lib/examples/throughput/throughput.ino b/libraries/Bluefruit52Lib/examples/Peripheral/throughput/throughput.ino similarity index 100% rename from libraries/Bluefruit52Lib/examples/throughput/throughput.ino rename to libraries/Bluefruit52Lib/examples/Peripheral/throughput/throughput.ino From 62704ad287915907fc95835c04abb6f1342e66a9 Mon Sep 17 00:00:00 2001 From: Todd Treece Date: Thu, 9 Mar 2017 09:59:26 -0500 Subject: [PATCH 2/3] remove central example folder --- .../central_bleuart/central_bleuart.ino | 73 ------------------- .../central/central_scan/central_scan.ino | 64 ---------------- 2 files changed, 137 deletions(-) delete mode 100644 libraries/Bluefruit52Lib/examples/central/central_bleuart/central_bleuart.ino delete mode 100644 libraries/Bluefruit52Lib/examples/central/central_scan/central_scan.ino diff --git a/libraries/Bluefruit52Lib/examples/central/central_bleuart/central_bleuart.ino b/libraries/Bluefruit52Lib/examples/central/central_bleuart/central_bleuart.ino deleted file mode 100644 index 655af04f..00000000 --- a/libraries/Bluefruit52Lib/examples/central/central_bleuart/central_bleuart.ino +++ /dev/null @@ -1,73 +0,0 @@ -/********************************************************************* - This is an example for our nRF52 based Bluefruit LE modules - - Pick one up today in the adafruit shop! - - Adafruit invests time and resources providing this open source code, - please support Adafruit and open-source hardware by purchasing - products from Adafruit! - - MIT license, check LICENSE for more information - All text above, and the splash screen below must be included in - any redistribution -*********************************************************************/ - -#include - -void setup() -{ - Serial.begin(115200); - - Serial.println("Bluefruit52 Central Scan Example"); - - // up to 1 peripheral conn and 1 central conn - Bluefruit.begin(true, true); - Bluefruit.setName("Bluefruit52"); - - // Increase BLink rate to different from PrPh advertising mode - Bluefruit.setConnLedInterval(250); - - // Callbacks for Central - Bluefruit.Central.setConnectCallback(connect_callback); - Bluefruit.Central.setDisconnectCallback(disconnect_callback); - - // Start Central Scan - Bluefruit.Central.setScanCallback(scan_callback); - Bluefruit.Central.startScanning(); -} - -void scan_callback(ble_gap_evt_adv_report_t* report) -{ - // Check if advertising contain BleUart service - if ( Bluefruit.Central.checkUuidInScan(report, BLEUART_UUID_SERVICE) ) - { - Serial.println("BLE UART service detected"); - Serial.println("Attempt to connect ... "); - - // Connect to device with bleuart service in advertising - // Use Min & Max Connection Interval default value - Bluefruit.Central.connect(report); - } -} - -void connect_callback(void) -{ - Serial.println("Connected"); -} - -void disconnect_callback(uint8_t reason) -{ - (void) reason; - - Serial.println("Disconnected"); - Serial.println("Bluefruit will auto start scanning (default)"); -} - -void loop() -{ - // Toggle both LEDs every 1 second - digitalToggle(LED_BUILTIN); - - delay(1000); -} - diff --git a/libraries/Bluefruit52Lib/examples/central/central_scan/central_scan.ino b/libraries/Bluefruit52Lib/examples/central/central_scan/central_scan.ino deleted file mode 100644 index 53b0e8b3..00000000 --- a/libraries/Bluefruit52Lib/examples/central/central_scan/central_scan.ino +++ /dev/null @@ -1,64 +0,0 @@ -/********************************************************************* - This is an example for our nRF52 based Bluefruit LE modules - - Pick one up today in the adafruit shop! - - Adafruit invests time and resources providing this open source code, - please support Adafruit and open-source hardware by purchasing - products from Adafruit! - - MIT license, check LICENSE for more information - All text above, and the splash screen below must be included in - any redistribution -*********************************************************************/ - -#include - -void setup() -{ - Serial.begin(115200); - - Serial.println("Bluefruit52 Central Scan Example"); - - // up to 1 peripheral conn and 1 central conn - Bluefruit.begin(true, true); - Bluefruit.setName("Bluefruit52"); - - // Start Central Scan - Bluefruit.setConnLedInterval(250); - Bluefruit.Central.setScanCallback(scan_callback); - Bluefruit.Central.startScanning(); -} - -void scan_callback(ble_gap_evt_adv_report_t* report) -{ - Serial.println("Timestamp Addr Rssi Data"); - - Serial.printf("%09d ", millis()); - - Serial.printBuffer(report->peer_addr.addr, 6, ':'); - Serial.print(" "); - - Serial.print(report->rssi); - Serial.print(" "); - - Serial.printBuffer(report->data, report->dlen, '-'); - Serial.println(); - - // Check if advertising contain BleUart service - if ( Bluefruit.Central.checkUuidInScan(report, BLEUART_UUID_SERVICE) ) - { - Serial.println(" BLE UART service detected"); - } - - Serial.println(); -} - -void loop() -{ - // Toggle both LEDs every 1 second - digitalToggle(LED_BUILTIN); - - delay(1000); -} - From f43c8df7e237f8a66bda558687687f922269717c Mon Sep 17 00:00:00 2001 From: Todd Treece Date: Thu, 9 Mar 2017 10:00:48 -0500 Subject: [PATCH 3/3] add Central example folder --- .../central_bleuart/central_bleuart.ino | 73 +++++++++++++++++++ .../Central/central_scan/central_scan.ino | 64 ++++++++++++++++ 2 files changed, 137 insertions(+) create mode 100644 libraries/Bluefruit52Lib/examples/Central/central_bleuart/central_bleuart.ino create mode 100644 libraries/Bluefruit52Lib/examples/Central/central_scan/central_scan.ino diff --git a/libraries/Bluefruit52Lib/examples/Central/central_bleuart/central_bleuart.ino b/libraries/Bluefruit52Lib/examples/Central/central_bleuart/central_bleuart.ino new file mode 100644 index 00000000..655af04f --- /dev/null +++ b/libraries/Bluefruit52Lib/examples/Central/central_bleuart/central_bleuart.ino @@ -0,0 +1,73 @@ +/********************************************************************* + This is an example for our nRF52 based Bluefruit LE modules + + Pick one up today in the adafruit shop! + + Adafruit invests time and resources providing this open source code, + please support Adafruit and open-source hardware by purchasing + products from Adafruit! + + MIT license, check LICENSE for more information + All text above, and the splash screen below must be included in + any redistribution +*********************************************************************/ + +#include + +void setup() +{ + Serial.begin(115200); + + Serial.println("Bluefruit52 Central Scan Example"); + + // up to 1 peripheral conn and 1 central conn + Bluefruit.begin(true, true); + Bluefruit.setName("Bluefruit52"); + + // Increase BLink rate to different from PrPh advertising mode + Bluefruit.setConnLedInterval(250); + + // Callbacks for Central + Bluefruit.Central.setConnectCallback(connect_callback); + Bluefruit.Central.setDisconnectCallback(disconnect_callback); + + // Start Central Scan + Bluefruit.Central.setScanCallback(scan_callback); + Bluefruit.Central.startScanning(); +} + +void scan_callback(ble_gap_evt_adv_report_t* report) +{ + // Check if advertising contain BleUart service + if ( Bluefruit.Central.checkUuidInScan(report, BLEUART_UUID_SERVICE) ) + { + Serial.println("BLE UART service detected"); + Serial.println("Attempt to connect ... "); + + // Connect to device with bleuart service in advertising + // Use Min & Max Connection Interval default value + Bluefruit.Central.connect(report); + } +} + +void connect_callback(void) +{ + Serial.println("Connected"); +} + +void disconnect_callback(uint8_t reason) +{ + (void) reason; + + Serial.println("Disconnected"); + Serial.println("Bluefruit will auto start scanning (default)"); +} + +void loop() +{ + // Toggle both LEDs every 1 second + digitalToggle(LED_BUILTIN); + + delay(1000); +} + diff --git a/libraries/Bluefruit52Lib/examples/Central/central_scan/central_scan.ino b/libraries/Bluefruit52Lib/examples/Central/central_scan/central_scan.ino new file mode 100644 index 00000000..53b0e8b3 --- /dev/null +++ b/libraries/Bluefruit52Lib/examples/Central/central_scan/central_scan.ino @@ -0,0 +1,64 @@ +/********************************************************************* + This is an example for our nRF52 based Bluefruit LE modules + + Pick one up today in the adafruit shop! + + Adafruit invests time and resources providing this open source code, + please support Adafruit and open-source hardware by purchasing + products from Adafruit! + + MIT license, check LICENSE for more information + All text above, and the splash screen below must be included in + any redistribution +*********************************************************************/ + +#include + +void setup() +{ + Serial.begin(115200); + + Serial.println("Bluefruit52 Central Scan Example"); + + // up to 1 peripheral conn and 1 central conn + Bluefruit.begin(true, true); + Bluefruit.setName("Bluefruit52"); + + // Start Central Scan + Bluefruit.setConnLedInterval(250); + Bluefruit.Central.setScanCallback(scan_callback); + Bluefruit.Central.startScanning(); +} + +void scan_callback(ble_gap_evt_adv_report_t* report) +{ + Serial.println("Timestamp Addr Rssi Data"); + + Serial.printf("%09d ", millis()); + + Serial.printBuffer(report->peer_addr.addr, 6, ':'); + Serial.print(" "); + + Serial.print(report->rssi); + Serial.print(" "); + + Serial.printBuffer(report->data, report->dlen, '-'); + Serial.println(); + + // Check if advertising contain BleUart service + if ( Bluefruit.Central.checkUuidInScan(report, BLEUART_UUID_SERVICE) ) + { + Serial.println(" BLE UART service detected"); + } + + Serial.println(); +} + +void loop() +{ + // Toggle both LEDs every 1 second + digitalToggle(LED_BUILTIN); + + delay(1000); +} +