Skip to content

Commit 1673ae4

Browse files
per1234aentinger
authored andcommitted
Auto format code
The Artistic Style code formatter tool was used with Arduino's example_formatter.conf configuration file: https://github.com/arduino/Arduino/blob/master/build/shared/examples_formatter.conf
1 parent edc1a19 commit 1673ae4

24 files changed

+1096
-1147
lines changed

examples/ArduinoIoTCloud_LED_switch/ArduinoIoTCloud_LED_switch.ino

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ void setup() {
2929
// tell ArduinoIoTCloud to use our WiFi connection
3030
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
3131

32-
/*
33-
The following function allows you to obtain more information
32+
/*
33+
The following function allows you to obtain more information
3434
related to the state of network and IoT Cloud connection and errors
3535
the higher number the more granular information you'll get.
3636
The default is 0 (only errors).
3737
Maximum is 3
38-
38+
3939
setDebugMessageLevel(3);
4040
*/
4141
ArduinoCloud.printDebugInfo();

examples/ArduinoIoTCloud_LED_switch/arduino_secrets.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/*
2-
Fill in your login credentials:
2+
Fill in your login credentials:
33
4-
The following lines are used for WiFi enabled boards (MKR1000, MKR WiFi 1010)
4+
The following lines are used for WiFi enabled boards (MKR1000, MKR WiFi 1010)
55
*/
66
#define SECRET_SSID "YOUR_WIFI_NETWORK_NAME"
77
#define SECRET_PASS "YOUR_WIFI_PASSWORD"
88
/*
9-
If you prefer using a MKR GSM 1400 comment the lines above and uncommet the following.
10-
PIN, APN, Login and Password are supplied by your Cellular Data provider.
9+
If you prefer using a MKR GSM 1400 comment the lines above and uncommet the following.
10+
PIN, APN, Login and Password are supplied by your Cellular Data provider.
1111
*/
1212
#define SECRET_PIN ""
1313
#define SECRET_APN ""

examples/ArduinoIoTCloud_LED_switch/thingProperties.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <WiFiConnectionManager.h>
66
#elif defined(BOARD_HAS_GSM)
77
#include <GSMConnectionManager.h>
8-
#else
8+
#else
99
#error "Arduino IoT Cloud currently only supports MKR1000, MKR WiFi 1010 and MKR GSM 1400"
1010
#endif
1111

@@ -25,9 +25,9 @@ void initProperties() {
2525
}
2626

2727
#if defined(BOARD_HAS_WIFI)
28-
ConnectionManager * ArduinoIoTPreferredConnection = new WiFiConnectionManager(SECRET_SSID, SECRET_PASS);
28+
ConnectionManager * ArduinoIoTPreferredConnection = new WiFiConnectionManager(SECRET_SSID, SECRET_PASS);
2929
#elif defined(BOARD_HAS_GSM)
30-
ConnectionManager * ArduinoIoTPreferredConnection = new GSMConnectionManager (SECRET_PIN, SECRET_APN, SECRET_LOGIN, SECRET_PASS);
30+
ConnectionManager * ArduinoIoTPreferredConnection = new GSMConnectionManager(SECRET_PIN, SECRET_APN, SECRET_LOGIN, SECRET_PASS);
3131
#endif
3232

3333

examples/ArduinoIoTCloud_Travis_CI/ArduinoIoTCloud_Travis_CI.ino

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/*
2-
* This sketch is used in combination with Travis CI to check if
3-
* unintentional breaking changes are made to the used facing
4-
* Arduino IoT Cloud API.
5-
*/
2+
This sketch is used in combination with Travis CI to check if
3+
unintentional breaking changes are made to the used facing
4+
Arduino IoT Cloud API.
5+
*/
66

77
#include "arduino_secrets.h"
88
#include "thingProperties.h"
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/******************************************************************************
2-
* INCLUDE
2+
INCLUDE
33
******************************************************************************/
44

55
#include <ArduinoIoTCloud.h>
@@ -9,25 +9,25 @@
99
#include <WiFiConnectionManager.h>
1010
#elif defined(BOARD_HAS_GSM)
1111
#include <GSMConnectionManager.h>
12-
#else
12+
#else
1313
#error "Arduino IoT Cloud currently only supports MKR1000, MKR WiFi 1010 and MKR GSM 1400"
1414
#endif
1515

1616
/******************************************************************************
17-
* DEFINES
17+
DEFINES
1818
******************************************************************************/
1919

2020
#define THING_ID "ARDUINO_IOT_CLOUD_THING_ID"
2121

2222
/******************************************************************************
23-
* GLOBAL CONSTANTS
23+
GLOBAL CONSTANTS
2424
******************************************************************************/
2525

2626
int const MIN_DELTA_INT_PROPERTY = 5;
2727
float const MIN_DELTA_FLOAT_PROPERTY = 10.0f;
2828

2929
/******************************************************************************
30-
* GLOBAL VARIABLES
30+
GLOBAL VARIABLES
3131
******************************************************************************/
3232

3333
bool bool_property_1;
@@ -55,36 +55,36 @@ String str_property_7;
5555
String str_property_8;
5656

5757
#if defined(BOARD_HAS_WIFI)
58-
ConnectionManager * ArduinoIoTPreferredConnection = new WiFiConnectionManager(SECRET_SSID, SECRET_PASS);
58+
ConnectionManager * ArduinoIoTPreferredConnection = new WiFiConnectionManager(SECRET_SSID, SECRET_PASS);
5959
#elif defined(BOARD_HAS_GSM)
60-
ConnectionManager * ArduinoIoTPreferredConnection = new GSMConnectionManager (SECRET_PIN, SECRET_APN, SECRET_LOGIN, SECRET_PASS);
60+
ConnectionManager * ArduinoIoTPreferredConnection = new GSMConnectionManager(SECRET_PIN, SECRET_APN, SECRET_LOGIN, SECRET_PASS);
6161
#endif
6262

6363
/******************************************************************************
64-
* PROTOTYPES
64+
PROTOTYPES
6565
******************************************************************************/
6666

67-
void onBoolPropertyChange ();
68-
void onIntPropertyChange ();
69-
void onFloatPropertyChange ();
67+
void onBoolPropertyChange();
68+
void onIntPropertyChange();
69+
void onFloatPropertyChange();
7070
void onStringPropertyChange();
7171

7272
/******************************************************************************
73-
* FUNCTIONS
73+
FUNCTIONS
7474
******************************************************************************/
7575

7676
void initProperties() {
7777
ArduinoCloud.setThingId(THING_ID);
7878

79-
ArduinoCloud.addProperty(bool_property_1, READWRITE, 1*SECONDS);
80-
ArduinoCloud.addProperty(int_property_1, READ, 2*MINUTES);
81-
ArduinoCloud.addProperty(float_property_1, WRITE, 3*HOURS );
82-
ArduinoCloud.addProperty(str_property_1, READWRITE, 4*DAYS );
79+
ArduinoCloud.addProperty(bool_property_1, READWRITE, 1 * SECONDS);
80+
ArduinoCloud.addProperty(int_property_1, READ, 2 * MINUTES);
81+
ArduinoCloud.addProperty(float_property_1, WRITE, 3 * HOURS);
82+
ArduinoCloud.addProperty(str_property_1, READWRITE, 4 * DAYS);
8383

84-
ArduinoCloud.addProperty(bool_property_2, Permission::ReadWrite).publishEvery(1*SECONDS);
85-
ArduinoCloud.addProperty(int_property_2, Permission::Read ).publishEvery(1*MINUTES);
86-
ArduinoCloud.addProperty(float_property_2, Permission::Write ).publishEvery(3*HOURS );
87-
ArduinoCloud.addProperty(str_property_2, Permission::ReadWrite).publishEvery(4*DAYS );
84+
ArduinoCloud.addProperty(bool_property_2, Permission::ReadWrite).publishEvery(1 * SECONDS);
85+
ArduinoCloud.addProperty(int_property_2, Permission::Read).publishEvery(1 * MINUTES);
86+
ArduinoCloud.addProperty(float_property_2, Permission::Write).publishEvery(3 * HOURS);
87+
ArduinoCloud.addProperty(str_property_2, Permission::ReadWrite).publishEvery(4 * DAYS);
8888

8989
ArduinoCloud.addProperty(int_property_3, READWRITE, ON_CHANGE); /* Default 'minDelta' = 0 */
9090
ArduinoCloud.addProperty(int_property_4, READWRITE, ON_CHANGE, onIntPropertyChange); /* Default 'minDelta' = 0 */
@@ -94,11 +94,11 @@ void initProperties() {
9494
ArduinoCloud.addProperty(float_property_3, Permission::ReadWrite).publishOnChange(MIN_DELTA_FLOAT_PROPERTY);
9595
ArduinoCloud.addProperty(float_property_4, Permission::ReadWrite).publishOnChange(MIN_DELTA_FLOAT_PROPERTY).onUpdate(onFloatPropertyChange);
9696

97-
ArduinoCloud.addProperty(str_property_3, READWRITE, 1*SECONDS, 0 /* onStringPropertyChange */, "" /* 'minDelta' */, MOST_RECENT_WINS);
98-
ArduinoCloud.addProperty(str_property_4, READWRITE, 1*SECONDS, 0 /* onStringPropertyChange */, "" /* 'minDelta' */, CLOUD_WINS);
99-
ArduinoCloud.addProperty(str_property_5, READWRITE, 1*SECONDS, 0 /* onStringPropertyChange */, "" /* 'minDelta' */, DEVICE_WINS);
97+
ArduinoCloud.addProperty(str_property_3, READWRITE, 1 * SECONDS, 0 /* onStringPropertyChange */, "" /* 'minDelta' */, MOST_RECENT_WINS);
98+
ArduinoCloud.addProperty(str_property_4, READWRITE, 1 * SECONDS, 0 /* onStringPropertyChange */, "" /* 'minDelta' */, CLOUD_WINS);
99+
ArduinoCloud.addProperty(str_property_5, READWRITE, 1 * SECONDS, 0 /* onStringPropertyChange */, "" /* 'minDelta' */, DEVICE_WINS);
100100

101-
ArduinoCloud.addProperty(str_property_6, Permission::ReadWrite).publishEvery(1*SECONDS).onSync(MOST_RECENT_WINS);
102-
ArduinoCloud.addProperty(str_property_7, Permission::ReadWrite).publishEvery(1*SECONDS).onSync(CLOUD_WINS);
103-
ArduinoCloud.addProperty(str_property_8, Permission::ReadWrite).publishEvery(1*SECONDS).onSync(DEVICE_WINS);
101+
ArduinoCloud.addProperty(str_property_6, Permission::ReadWrite).publishEvery(1 * SECONDS).onSync(MOST_RECENT_WINS);
102+
ArduinoCloud.addProperty(str_property_7, Permission::ReadWrite).publishEvery(1 * SECONDS).onSync(CLOUD_WINS);
103+
ArduinoCloud.addProperty(str_property_8, Permission::ReadWrite).publishEvery(1 * SECONDS).onSync(DEVICE_WINS);
104104
}

examples/utility/Provisioning/Provisioning.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void setup() {
8888
hexStringToBytes(serialNumber, serialNumberBytes, sizeof(serialNumberBytes));
8989
hexStringToBytes(authorityKeyIdentifier, authorityKeyIdentifierBytes, sizeof(authorityKeyIdentifierBytes));
9090
hexStringToBytes(signature, signatureBytes, sizeof(signatureBytes));
91-
91+
9292
if (!ECCX08.writeSlot(deviceIdSlot, deviceIdBytes, sizeof(deviceIdBytes))) {
9393
Serial.println("Error storing device id!");
9494
while (1);

0 commit comments

Comments
 (0)