From 94a8723420b6e984835232dd46a6b9a3880b0aa3 Mon Sep 17 00:00:00 2001 From: Sandeep Mistry Date: Fri, 17 Jun 2016 17:29:47 -0400 Subject: [PATCH] Make WiFiClient and HttpClient global var in example --- examples/SimpleHttpExample/SimpleHttpExample.ino | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/SimpleHttpExample/SimpleHttpExample.ino b/examples/SimpleHttpExample/SimpleHttpExample.ino index 550015a..a6aa6b6 100644 --- a/examples/SimpleHttpExample/SimpleHttpExample.ino +++ b/examples/SimpleHttpExample/SimpleHttpExample.ino @@ -25,6 +25,9 @@ const int kNetworkTimeout = 30*1000; // Number of milliseconds to wait if no data is available before trying again const int kNetworkDelay = 1000; +WiFiClient c; +HttpClient http(c, kHostname); + void setup() { //Initialize serial and wait for port to open: @@ -50,9 +53,6 @@ void loop() { int err =0; - WiFiClient c; - HttpClient http(c, kHostname); - err = http.get(kPath); if (err == 0) {