* ------ WIFI Example --------
* Explanation: This example shows how to join an access point (AP)
* Copyright (C) 2016 Libelium Comunicaciones Distribuidas S.L.
* http://www.libelium.com
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* Implementation: Yuri Carmona
#include <WaspWIFI_PRO.h>
uint8_t socket = SOCKET0;
USB.println(F("Start program"));
//////////////////////////////////////////////////
//////////////////////////////////////////////////
error = WIFI_PRO.ON(socket);
USB.println(F("1. WiFi switched ON"));
USB.println(F("1. WiFi did not initialize correctly"));
//////////////////////////////////////////////////
//////////////////////////////////////////////////
status = WIFI_PRO.isConnected();
// Check if module is connected
USB.print(F("2. WiFi is connected OK."));
USB.print(F(" Time(ms):"));
USB.println(millis()-previous);
error = WIFI_PRO.ping("www.google.com");
USB.print(F("3. PING OK. Round Trip Time(ms)="));
USB.println( WIFI_PRO._rtt, DEC );
USB.println(F("3. Error calling 'ping' function"));
USB.print(F("2. WiFi is connected ERROR."));
USB.print(F(" Time(ms):"));
USB.println(millis()-previous);
//////////////////////////////////////////////////
//////////////////////////////////////////////////
USB.println(F("4. WiFi switched OFF\n\n"));