mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-19 09:42:11 +03:00
Run new astyle formatter against all the examples
This commit is contained in:
@ -1,13 +1,13 @@
|
||||
/*
|
||||
GSM Web Server
|
||||
|
||||
|
||||
A simple web server that shows the value of the analog input pins.
|
||||
using a GSM shield.
|
||||
|
||||
Circuit:
|
||||
* GSM shield attached
|
||||
* Analog inputs attached to pins A0 through A5 (optional)
|
||||
|
||||
|
||||
created 8 Mar 2012
|
||||
by Tom Igoe
|
||||
*/
|
||||
@ -30,7 +30,7 @@ GSM gsmAccess; // include a 'true' parameter for debug enabled
|
||||
GSMServer server(80); // port 80 (http default)
|
||||
|
||||
// timeout
|
||||
const unsigned long __TIMEOUT__ = 10*1000;
|
||||
const unsigned long __TIMEOUT__ = 10 * 1000;
|
||||
|
||||
void setup()
|
||||
{
|
||||
@ -39,16 +39,16 @@ void setup()
|
||||
while (!Serial) {
|
||||
; // wait for serial port to connect. Needed for Leonardo only
|
||||
}
|
||||
|
||||
|
||||
// connection state
|
||||
boolean notConnected = true;
|
||||
|
||||
|
||||
// Start GSM shield
|
||||
// If your SIM has PIN, pass it as a parameter of begin() in quotes
|
||||
while(notConnected)
|
||||
while (notConnected)
|
||||
{
|
||||
if((gsmAccess.begin(PINNUMBER)==GSM_READY) &
|
||||
(gprs.attachGPRS(GPRS_APN, GPRS_LOGIN, GPRS_PASSWORD)==GPRS_READY))
|
||||
if ((gsmAccess.begin(PINNUMBER) == GSM_READY) &
|
||||
(gprs.attachGPRS(GPRS_APN, GPRS_LOGIN, GPRS_PASSWORD) == GPRS_READY))
|
||||
notConnected = false;
|
||||
else
|
||||
{
|
||||
@ -56,12 +56,12 @@ void setup()
|
||||
delay(1000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Serial.println("Connected to GPRS network");
|
||||
|
||||
|
||||
// start server
|
||||
server.begin();
|
||||
|
||||
|
||||
//Get IP.
|
||||
IPAddress LocalIP = gprs.getIPAddress();
|
||||
Serial.println("Server IP address=");
|
||||
@ -77,21 +77,21 @@ void loop() {
|
||||
|
||||
|
||||
if (client)
|
||||
{
|
||||
{
|
||||
while (client.connected())
|
||||
{
|
||||
if (client.available())
|
||||
{
|
||||
Serial.println("Receiving request!");
|
||||
bool sendResponse = false;
|
||||
while(char c=client.read()) {
|
||||
while (char c = client.read()) {
|
||||
if (c == '\n') sendResponse = true;
|
||||
}
|
||||
|
||||
// if you've gotten to the end of the line (received a newline
|
||||
// character)
|
||||
if (sendResponse)
|
||||
{
|
||||
// if you've gotten to the end of the line (received a newline
|
||||
// character)
|
||||
if (sendResponse)
|
||||
{
|
||||
// send a standard http response header
|
||||
client.println("HTTP/1.1 200 OK");
|
||||
client.println("Content-Type: text/html");
|
||||
@ -103,7 +103,7 @@ void loop() {
|
||||
client.print(analogChannel);
|
||||
client.print(" is ");
|
||||
client.print(analogRead(analogChannel));
|
||||
client.println("<br />");
|
||||
client.println("<br />");
|
||||
}
|
||||
client.println("</html>");
|
||||
//necessary delay
|
||||
|
Reference in New Issue
Block a user