Skip to content

Commit a79d2cd

Browse files
author
Ilya Dmitrichenko
committed
Move function definition
1 parent 88a4b9b commit a79d2cd

File tree

3 files changed

+50
-55
lines changed

3 files changed

+50
-55
lines changed

examples/WiFiDatastreamDownload/WiFiDatastreamDownload.ino

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,23 @@ CosmFeed feed(15552, datastreams, 1 /* number of datastreams */);
2424
WiFiClient client;
2525
CosmClient cosmclient(client);
2626

27+
void printWifiStatus() {
28+
// print the SSID of the network you're attached to:
29+
Serial.print("SSID: ");
30+
Serial.println(WiFi.SSID());
31+
32+
// print your WiFi shield's IP address:
33+
IPAddress ip = WiFi.localIP();
34+
Serial.print("IP Address: ");
35+
Serial.println(ip);
36+
37+
// print the received signal strength:
38+
long rssi = WiFi.RSSI();
39+
Serial.print("signal strength (RSSI):");
40+
Serial.print(rssi);
41+
Serial.println(" dBm");
42+
}
43+
2744
void setup() {
2845
// put your setup code here, to run once:
2946
Serial.begin(9600);
@@ -60,22 +77,3 @@ void loop() {
6077
Serial.println();
6178
delay(15000UL);
6279
}
63-
64-
void printWifiStatus() {
65-
// print the SSID of the network you're attached to:
66-
Serial.print("SSID: ");
67-
Serial.println(WiFi.SSID());
68-
69-
// print your WiFi shield's IP address:
70-
IPAddress ip = WiFi.localIP();
71-
Serial.print("IP Address: ");
72-
Serial.println(ip);
73-
74-
// print the received signal strength:
75-
long rssi = WiFi.RSSI();
76-
Serial.print("signal strength (RSSI):");
77-
Serial.print(rssi);
78-
Serial.println(" dBm");
79-
}
80-
81-

examples/WiFiDatastreamUpload/WiFiDatastreamUpload.ino

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,22 @@ CosmFeed feed(15552, datastreams, 1 /* number of datastreams */);
2626
WiFiClient client;
2727
CosmClient cosmclient(client);
2828

29+
void printWifiStatus() {
30+
// print the SSID of the network you're attached to:
31+
Serial.print("SSID: ");
32+
Serial.println(WiFi.SSID());
33+
34+
// print your WiFi shield's IP address:
35+
IPAddress ip = WiFi.localIP();
36+
Serial.print("IP Address: ");
37+
Serial.println(ip);
38+
39+
// print the received signal strength:
40+
long rssi = WiFi.RSSI();
41+
Serial.print("signal strength (RSSI):");
42+
Serial.print(rssi);
43+
Serial.println(" dBm");
44+
}
2945
void setup() {
3046
// put your setup code here, to run once:
3147
Serial.begin(9600);
@@ -60,21 +76,3 @@ void loop() {
6076
Serial.println();
6177
delay(15000);
6278
}
63-
64-
void printWifiStatus() {
65-
// print the SSID of the network you're attached to:
66-
Serial.print("SSID: ");
67-
Serial.println(WiFi.SSID());
68-
69-
// print your WiFi shield's IP address:
70-
IPAddress ip = WiFi.localIP();
71-
Serial.print("IP Address: ");
72-
Serial.println(ip);
73-
74-
// print the received signal strength:
75-
long rssi = WiFi.RSSI();
76-
Serial.print("signal strength (RSSI):");
77-
Serial.print(rssi);
78-
Serial.println(" dBm");
79-
}
80-

examples/WiFiMultipleDatastreamsUpload/WiFiMultipleDatastreamsUpload.ino

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,23 @@ CosmFeed feed(15552, datastreams, 3 /* number of datastreams */);
3232
WiFiClient client;
3333
CosmClient cosmclient(client);
3434

35+
void printWifiStatus() {
36+
// print the SSID of the network you're attached to:
37+
Serial.print("SSID: ");
38+
Serial.println(WiFi.SSID());
39+
40+
// print your WiFi shield's IP address:
41+
IPAddress ip = WiFi.localIP();
42+
Serial.print("IP Address: ");
43+
Serial.println(ip);
44+
45+
// print the received signal strength:
46+
long rssi = WiFi.RSSI();
47+
Serial.print("signal strength (RSSI):");
48+
Serial.print(rssi);
49+
Serial.println(" dBm");
50+
}
51+
3552
void setup() {
3653
// put your setup code here, to run once:
3754
Serial.begin(9600);
@@ -77,21 +94,3 @@ void loop() {
7794
Serial.println();
7895
delay(15000);
7996
}
80-
81-
void printWifiStatus() {
82-
// print the SSID of the network you're attached to:
83-
Serial.print("SSID: ");
84-
Serial.println(WiFi.SSID());
85-
86-
// print your WiFi shield's IP address:
87-
IPAddress ip = WiFi.localIP();
88-
Serial.print("IP Address: ");
89-
Serial.println(ip);
90-
91-
// print the received signal strength:
92-
long rssi = WiFi.RSSI();
93-
Serial.print("signal strength (RSSI):");
94-
Serial.print(rssi);
95-
Serial.println(" dBm");
96-
}
97-

0 commit comments

Comments
 (0)