Skip to content

Commit bbd7bdb

Browse files
committed
Improve code formatting for sketches of CurieBLE library
Update code formatting for sketches of CurieBLE library with the Auto Format tool of Arduino IDE Signed-off-by: Biagio Montaruli <[email protected]>
1 parent 5db6d30 commit bbd7bdb

File tree

11 files changed

+554
-554
lines changed

11 files changed

+554
-554
lines changed

libraries/CurieBLE/examples/BatteryAdvChange/BatteryAdvChange.ino

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ BLEPeripheral blePeripheral; // BLE Peripheral Device (the board you're pr
2020
BLEService batteryService("180F"); // BLE Battery Service
2121

2222
// BLE Battery Level Characteristic with standard 16-bit characteristic UUID.
23-
// This characteristic has Read and Notify properties that allow remote clients
23+
// This characteristic has Read and Notify properties that allow remote clients
2424
// to get notifications when this characteristic changes
2525
BLEUnsignedCharCharacteristic batteryLevelChar("2A19", BLERead | BLENotify);
2626

@@ -31,13 +31,13 @@ void setup() {
3131
// initialize serial communication
3232
Serial.begin(9600);
3333
// wait for the serial port to connect. Open the Serial Monitor to continue executing the sketch
34-
// If you don't care to see text messages sent to the Serial Monitor during board initialization,
34+
// If you don't care to see text messages sent to the Serial Monitor during board initialization,
3535
// uncomment the next line
36-
while(!Serial) ;
37-
// initialize the LED on pin 13. When the BLE device will switch to connectable mode
38-
// the on-board LED will be turned on, otherwise turn the on-board LED off
36+
while (!Serial) ;
37+
// initialize the LED on pin 13. When the BLE device will switch to connectable mode
38+
// the on-board LED will be turned on, otherwise turn the on-board LED off
3939
pinMode(LED_BUILTIN, OUTPUT);
40-
40+
4141
/* Set a local name for the BLE device
4242
This name will appear in advertising packets
4343
and can be used by remote devices to identify this BLE device
@@ -91,7 +91,7 @@ void loop() {
9191
Serial.println("In Connectable mode");
9292
// turn the on-board LED off
9393
digitalWrite(LED_BUILTIN, HIGH);
94-
94+
9595
}
9696
Serial.println("Start Advertising...");
9797
blePeripheral.startAdvertising();

libraries/CurieBLE/examples/BatteryMonitor/BatteryMonitor.ino

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
2-
* Copyright (c) 2016 Intel Corporation. All rights reserved.
3-
* See the bottom of this file for the license terms.
4-
*/
2+
Copyright (c) 2016 Intel Corporation. All rights reserved.
3+
See the bottom of this file for the license terms.
4+
*/
55

66
#include <CurieBLE.h>
77

@@ -18,7 +18,7 @@ BLEPeripheral blePeripheral; // BLE Peripheral Device (the board you're pr
1818
BLEService batteryService("180F"); // BLE Battery Service with standard 16-bit UUID
1919

2020
// BLE Battery Level Characteristic with standard 16-bit characteristic UUID
21-
// This characteristic has Read and Notify properties that allow remote clients
21+
// This characteristic has Read and Notify properties that allow remote clients
2222
// to get notifications when this characteristic changes
2323
BLEUnsignedCharCharacteristic batteryLevelChar("2A19", BLERead | BLENotify);
2424

@@ -29,9 +29,9 @@ void setup() {
2929
// initialize serial communication
3030
Serial.begin(9600);
3131
// wait for the serial port to connect. Open the Serial Monitor to continue executing the sketch
32-
// If you don't care to see text messages sent to the Serial Monitor during board initialization,
32+
// If you don't care to see text messages sent to the Serial Monitor during board initialization,
3333
// uncomment the next line
34-
while(!Serial) ;
34+
while (!Serial) ;
3535
// initialize the LED on pin 13 to indicate when a central is connected
3636
pinMode(LED_BUILTIN, OUTPUT);
3737

@@ -73,12 +73,12 @@ void loop() {
7373
previousMillis = currentMillis;
7474
updateBatteryLevel();
7575

76-
static unsigned short count = 0;
76+
static unsigned short count = 0;
7777
count++;
7878
// update the connection interval
79-
if(count % 5 == 0){
79+
if (count % 5 == 0) {
8080
delay(1000);
81-
updateIntervalParams(central);
81+
updateIntervalParams(central);
8282
}
8383
}
8484
}
@@ -92,7 +92,7 @@ void loop() {
9292
void updateBatteryLevel() {
9393
/* Read the current voltage level on the A0 analog input pin.
9494
This is used here to simulate the charge level of a battery.
95-
*/
95+
*/
9696
int battery = analogRead(A0);
9797
int batteryLevel = map(battery, 0, 1023, 0, 100);
9898

@@ -118,16 +118,16 @@ void updateIntervalParams(BLECentralHelper &central) {
118118
Serial.println(m_conn_param.latency);
119119
Serial.print("timeout = ");
120120
Serial.println(m_conn_param.timeout);
121-
121+
122122
// Update connection interval
123123
Serial.println("setting Connection Interval...");
124124
central.setConnectionInterval(interval, interval);
125125

126126
interval++;
127-
if(interval < 0x06) {
127+
if (interval < 0x06) {
128128
interval = 0x06;
129129
}
130-
if(interval > 0x100) {
130+
if (interval > 0x100) {
131131
interval = 0x06;
132132
}
133133
}

libraries/CurieBLE/examples/ButtonLED/ButtonLED.ino

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
2-
* Copyright (c) 2016 Intel Corporation. All rights reserved.
3-
* See the bottom of this file for the license terms.
4-
*/
2+
Copyright (c) 2016 Intel Corporation. All rights reserved.
3+
See the bottom of this file for the license terms.
4+
*/
55

66
/*
77
This example can work with phone BLE app.
@@ -11,7 +11,7 @@
1111
After the sketch starts connect to a BLE app on a phone and set notification to the Characteristic and you should see it update
1212
whenever the button is pressed. This sketch is not written to pair with any of the central examples.
1313
*/
14-
14+
1515
#include <CurieBLE.h>
1616

1717
const int ledPin = 13; // set ledPin to on-board LED
@@ -24,10 +24,10 @@ BLEPeripheral blePeripheral;
2424
// Long UUID denote custom user created UUID
2525
BLEService ledService("19B10010-E8F2-537E-4F6C-D104768A1214");
2626

27-
// create switch characteristic with Read and Write properties that allow remote clients
27+
// create switch characteristic with Read and Write properties that allow remote clients
2828
// to read and write this characteristic value
2929
BLECharCharacteristic ledCharacteristic("19B10011-E8F2-537E-4F6C-D104768A1214", BLERead | BLEWrite);
30-
// create button characteristic with Read and Notify properties that allow remote clients
30+
// create button characteristic with Read and Notify properties that allow remote clients
3131
// to get notifications when this characteristic value changes
3232
BLECharCharacteristic buttonCharacteristic("19B10012-E8F2-537E-4F6C-D104768A1214", BLERead | BLENotify);
3333
// Notice the use of Typed Characteristics. These previous 2 characeristics are of the type char
@@ -36,14 +36,14 @@ void setup() {
3636
// initialize serial communication
3737
Serial.begin(9600);
3838
// wait for the serial port to connect. Open the Serial Monitor to continue executing the sketch
39-
// If you don't care to see text messages sent to the Serial Monitor during board initialization,
39+
// If you don't care to see text messages sent to the Serial Monitor during board initialization,
4040
// uncomment the next line
41-
while(!Serial) ;
41+
while (!Serial) ;
4242
pinMode(ledPin, OUTPUT); // set the LED pin 13 as output
4343
pinMode(buttonPin, INPUT); // set the button pin 4 as input
4444

45-
// Set a local name for the BLE device.
46-
// This name will appear in advertising packets
45+
// Set a local name for the BLE device.
46+
// This name will appear in advertising packets
4747
// and can be used by remote devices to identify this BLE device
4848
blePeripheral.setLocalName("ButtonLED");
4949
// set the UUID for the service that this peripheral advertises:
@@ -82,7 +82,7 @@ void loop() {
8282

8383
if (ledCharacteristic.written() || buttonChanged) {
8484
// update LED, either central has written to characteristic or button state has changed.
85-
// If you are using a phone or a BLE central device that is aware of this characteristic,
85+
// If you are using a phone or a BLE central device that is aware of this characteristic,
8686
// writing a value of 0x40 for example will be interpreted as written
8787
if (ledCharacteristic.value()) {
8888
Serial.println("LED on");

libraries/CurieBLE/examples/CallbackLED/CallbackLED.ino

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*
2-
* Copyright (c) 2016 Intel Corporation. All rights reserved.
3-
* See the bottom of this file for the license terms.
4-
*/
5-
6-
/*
2+
Copyright (c) 2016 Intel Corporation. All rights reserved.
3+
See the bottom of this file for the license terms.
4+
*/
5+
6+
/*
77
This example can work with LEDCentral.
88
99
You should see the LED blink on and off.
@@ -13,29 +13,29 @@
1313
Connect to BLE device named LEDCB and explore characteristic with UUID 19B10001-E8F2-537E-4F6C-D104768A1214.
1414
Writing a byte value such as 0x40 should turn on the LED.
1515
Writing a byte value of 0x00 should turn off the LED.
16-
*/
16+
*/
1717

1818
#include <CurieBLE.h>
1919

2020
const int ledPin = 13; // the on-board LED is connected to digital pin 13
2121
BLEPeripheral blePeripheral; // create peripheral instance
22-
BLECentralHelper *bleCentral1 = NULL; // peer central device
22+
BLECentralHelper *bleCentral1 = NULL; // peer central device
2323

2424
// create service with a 128-bit UUID (32 characters exclusive of dashes).
2525
// Long UUID denote custom user created UUID.
2626
BLEService ledService("19B10000-E8F2-537E-4F6C-D104768A1214");
2727

28-
// create switch characteristic with a custom 128-bit UUID and enables Read and Write properties
28+
// create switch characteristic with a custom 128-bit UUID and enables Read and Write properties
2929
// to allow remote device to read and write this characteristic value
3030
BLECharCharacteristic switchChar("19B10001-E8F2-537E-4F6C-D104768A1214", BLERead | BLEWrite);
3131

3232
void setup() {
3333
// initialize serial communication
3434
Serial.begin(9600);
3535
// wait for the serial port to connect. Open the Serial Monitor to continue executing the sketch
36-
// If you don't care to see text messages sent to the Serial Monitor during board initialization,
36+
// If you don't care to see text messages sent to the Serial Monitor during board initialization,
3737
// uncomment the next line
38-
while(!Serial) ;
38+
while (!Serial) ;
3939
pinMode(ledPin, OUTPUT); // set the pin 13 of the on-board LED as output
4040

4141
// set the local name for the peripheral that advertises

0 commit comments

Comments
 (0)