File tree 10 files changed +71
-56
lines changed
libraries/CurieBLE/examples
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
+
2
3
/*
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.
11
14
*/
12
15
13
16
#include < CurieBLE.h>
Original file line number Diff line number Diff line change 6
6
#include < CurieBLE.h>
7
7
8
8
/*
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
14
15
*/
15
16
16
17
/* */
Original file line number Diff line number Diff line change 3
3
* See the bottom of this file for the license terms.
4
4
*/
5
5
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
+ */
12
14
13
15
#include < CurieBLE.h>
14
16
Original file line number Diff line number Diff line change 3
3
* See the bottom of this file for the license terms.
4
4
*/
5
5
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
+ */
14
17
15
18
#include < CurieBLE.h>
16
19
Original file line number Diff line number Diff line change 6
6
#include < CurieBLE.h>
7
7
8
8
/*
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.
15
15
*/
16
16
17
17
#define MAX_IMU_RECORD 1
Original file line number Diff line number Diff line change 7
7
#include < CurieIMU.h>
8
8
9
9
/*
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.
13
14
*/
14
15
15
16
#define MAX_IMU_RECORD 1
Original file line number Diff line number Diff line change 3
3
* See the bottom of this file for the license terms.
4
4
*/
5
5
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
+ */
15
17
16
18
#include < CurieBLE.h>
17
19
Original file line number Diff line number Diff line change 6
6
#include < CurieBLE.h>
7
7
8
8
/*
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.
12
13
*/
13
14
14
15
// set up connection params
Original file line number Diff line number Diff line change 6
6
#include < CurieBLE.h>
7
7
8
8
/*
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.
14
15
*/
15
16
16
17
Original file line number Diff line number Diff line change 6
6
#include < CurieBLE.h>
7
7
8
8
/*
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.
11
12
*/
12
13
13
14
// set up connection params
You can’t perform that action at this time.
0 commit comments