File tree Expand file tree Collapse file tree 10 files changed +71
-56
lines changed
libraries/CurieBLE/examples Expand file tree Collapse file tree 10 files changed +71
-56
lines changed Original file line number Diff line number Diff line change 1- /* Please see code cpyright at the bottom of this example code */
1+ /* Please see code copyright at the bottom of this example code */
2+
23/*
3- This sketch illustrates how to change the advertising data so that it is visible but not
4- connectable. Then after 10 seconds it changes to being connectable
5- This sketch example partially implements the standard Bluetooth Low-Energy Battery service.
6-
7- This sketch is not paired with a specific central example sketch,
8- but to see how it works you need to use a BLE APP on your phone or central device
9- and try connecting when it is either a connectable or not connectable state
10- as displayed in the serial monitor.
4+ This example can work with phone BLE app.
5+
6+ This sketch illustrates how to change the advertising data so that it is visible but not
7+ connectable. Then after 10 seconds it changes to being connectable.
8+ This sketch example partially implements the standard Bluetooth Low-Energy Battery service.
9+
10+ This sketch is not paired with a specific central example sketch,
11+ but to see how it works you need to use a BLE APP on your phone or central device
12+ and try connecting when it is either a connectable or not connectable state
13+ as displayed in the serial monitor.
1114*/
1215
1316#include < CurieBLE.h>
Original file line number Diff line number Diff line change 66#include < CurieBLE.h>
77
88/*
9- This sketch can work with UpdateConnectionInterval.
10- You can also use an android or IOS app that supports notifications
11- This sketch example partially implements the standard Bluetooth Low-Energy Battery service
12- and connection interval paramater update.
13- For more information: https://developer.bluetooth.org/gatt/services/Pages/ServicesHome.aspx
9+ This sketch can work with UpdateConnectionInterval.
10+
11+ You can also use an android or IOS app that supports notifications.
12+ This sketch example partially implements the standard Bluetooth Low-Energy Battery service
13+ and connection interval paramater update.
14+ For more information: https://developer.bluetooth.org/gatt/services/Pages/ServicesHome.aspx
1415*/
1516
1617/* */
Original file line number Diff line number Diff line change 33 * See the bottom of this file for the license terms.
44 */
55
6- /* This examples needs a button connected similarly as described here
7- https://www.arduino.cc/en/Tutorial/Button
8- The only difference is that instead of connecting to pin 2 connect to pin 4
9- After the sketch starts connect to a BLE app on a phone and set notification to the Characteristic and you should see it update
10- whenever the button is pressed. This sketch is not written to pair with any of the central examples.
11- */
6+ /*
7+ This example can work with phone BLE app.
8+
9+ This examples needs a button connected similarly as described here https://www.arduino.cc/en/Tutorial/Button
10+ The only difference is that instead of connecting to pin 2, it connects to pin 4
11+ After the sketch starts connect to a BLE app on a phone and set notification to the Characteristic and you should see it update
12+ whenever the button is pressed. This sketch is not written to pair with any of the central examples.
13+ */
1214
1315#include < CurieBLE.h>
1416
Original file line number Diff line number Diff line change 33 * See the bottom of this file for the license terms.
44 */
55
6- // This example can work with LEDCentral
7- // You should see the LED blink on and off
8- // This example demonstrates the use of Callback or event Handlers responding to events
9- // BLECoonected, BLEDisconnected and BLEWritten are events.
10- // To test interactively use a Phone app like nrf Controller (Android) or Light Blue (iOS)
11- // Connect to BLE device named LEDCB and explore characteristic with UUID 19B10001-E8F2-537E-4F6C-D104768A1214
12- // Writing a byte value such as 0x40 should turn on the LED
13- // Writng a byte value of 0x00 should turn off the LED
6+ /*
7+ This example can work with LEDCentral.
8+
9+ You should see the LED blink on and off.
10+ This example demonstrates the use of Callback or event Handlers responding to events.
11+ BLEConnected, BLEDisconnected and BLEWritten are events.
12+ To test interactively, use a Phone app like nrf Controller (Android) or Light Blue (iOS).
13+ Connect to BLE device named LEDCB and explore characteristic with UUID 19B10001-E8F2-537E-4F6C-D104768A1214.
14+ Writing a byte value such as 0x40 should turn on the LED.
15+ Writing a byte value of 0x00 should turn off the LED.
16+ */
1417
1518#include < CurieBLE.h>
1619
Original file line number Diff line number Diff line change 66#include < CurieBLE.h>
77
88/*
9- This sketch example works with IMUBleNotification.ino
10- IMUBleNotification.ino will send notification to this sketch.
11- This sketch will receive the notifications and out put the received data in the serial monitor
12- It also illustrates using a non typed characteristic
13- Set the baud rate to 115200 on the serial monitor to accomodate the speed of constant data updates from IMU subsystem
14-
9+ This sketch example works with IMUBleNotification.ino
10+
11+ IMUBleNotification.ino will send notification to this central sketch.
12+ This sketch will receive the notifications and output the received data in the serial monitor.
13+ It also illustrates using a non-typed characteristic.
14+ Set the baud rate to 115200 on the serial monitor to accomodate the speed of constant data updates from IMU subsystem.
1515*/
1616
1717#define MAX_IMU_RECORD 1
Original file line number Diff line number Diff line change 77#include < CurieIMU.h>
88
99/*
10- This sketch example works with IMUBleCentral.ino
11- This sketch will read IMU data from sensor and send notification to IMUBleCentral.ino
12- IMUBleCentral.ino will receive the Notifications and output the received data.
10+ This sketch example works with IMUBleCentral.ino.
11+
12+ This sketch will read IMU data from sensor and send notifications to IMUBleCentral.ino.
13+ IMUBleCentral.ino will receive the notifications and output the received data.
1314*/
1415
1516#define MAX_IMU_RECORD 1
Original file line number Diff line number Diff line change 33 * See the bottom of this file for the license terms.
44 */
55
6- // This example can work with LEDCentral
7- //
8- // This example is similar to CallbackLED example in functionality
9- // It does not use callbacks. In the loop it interogates the connection state with central
10- // Checks if the characteristic is wriiten and turns the LED on or off accordingly
11- // To test interactively, use a phone app like nrf Controller (Android) or Light Blue (iOS)
12- // Connect to BLE device named LEDCB and explore characteristic with UUID 19B10001-E8F2-537E-4F6C-D104768A1214
13- // Writing a byte value such as 0x40 should turn on the LED
14- // Writng a byte value of 0x00 should turn off the LED
6+ /*
7+ This example can work with LEDCentral
8+
9+ This example is similar to CallbackLED example in functionality.
10+ It does not use callbacks. In the loop it interogates the connection state with central.
11+ Checks if the characteristic is written and turns the LED on or off accordingly.
12+ To test interactively, use a phone app like nrf Controller (Android) or Light Blue (iOS).
13+ Connect to BLE device named LEDCB and explore characteristic with UUID 19B10001-E8F2-537E-4F6C-D104768A1214.
14+ Writing a byte value such as 0x40 should turn on the LED.
15+ Writing a byte value of 0x00 should turn off the LED.
16+ */
1517
1618#include < CurieBLE.h>
1719
Original file line number Diff line number Diff line change 66#include < CurieBLE.h>
77
88/*
9- This example can work with CallbackLED and LED
10- to show how a central device can do charcteristic read and write operations.
11- A third party serial terminal is recommended to see outputs from central and peripheral device
9+ This example can work with CallbackLED and LED sketches.
10+
11+ To show how a central device can do charcteristic read and write operations.
12+ A third party serial terminal is recommended to see outputs from central and peripheral device.
1213*/
1314
1415// set up connection params
Original file line number Diff line number Diff line change 66#include < CurieBLE.h>
77
88/*
9- This sketch try to show the scan function
10- The sketch will list the device's MAC address and device name to the console
11- The list will refresh every 3s
12- This sketch is meaningful if one or more BLE peripheral devices (any of the peripheral examples will do)
13- are present.
9+ This sketch is meaningful if one or more BLE peripheral devices (any of the peripheral examples will do)
10+ are present.
11+
12+ This sketch try to show the scan function.
13+ The sketch will list the device's MAC address and device name to the console.
14+ The list will refresh every 3s.
1415*/
1516
1617
Original file line number Diff line number Diff line change 66#include < CurieBLE.h>
77
88/*
9- This example can work with BatteryMonitor
10- to show how to control and response the connection intelval request.
9+ This example can work with BatteryMonitor.
10+
11+ Show how to control and response the connection interval request.
1112*/
1213
1314// set up connection params
You can’t perform that action at this time.
0 commit comments