|
| 1 | +/* |
| 2 | + Esp.cpp - ESP8266-specific APIs |
| 3 | + Copyright (c) 2015 Ivan Grokhotkov. All rights reserved. |
| 4 | + This file is part of the esp8266 core for Arduino environment. |
| 5 | +
|
| 6 | + This library is free software; you can redistribute it and/or |
| 7 | + modify it under the terms of the GNU Lesser General Public |
| 8 | + License as published by the Free Software Foundation; either |
| 9 | + version 2.1 of the License, or (at your option) any later version. |
| 10 | +
|
| 11 | + This library is distributed in the hope that it will be useful, |
| 12 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | + Lesser General Public License for more details. |
| 15 | +
|
| 16 | + You should have received a copy of the GNU Lesser General Public |
| 17 | + License along with this library; if not, write to the Free Software |
| 18 | + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 19 | + */ |
| 20 | + |
| 21 | +#include <Arduino.h> |
| 22 | +#include <user_interface.h> |
| 23 | +#include <core_version.h> |
| 24 | +#include <lwip/init.h> // LWIP_VERSION_* |
| 25 | +#include <lwipopts.h> // LWIP_HASH_STR (lwip2) |
| 26 | + |
| 27 | +#define STRHELPER(x) #x |
| 28 | +#define STR(x) STRHELPER(x) // stringifier |
| 29 | + |
| 30 | +static const char arduino_esp8266_git_ver [] PROGMEM = STR(ARDUINO_ESP8266_GIT_DESC); |
| 31 | +#if LWIP_VERSION_MAJOR != 1 |
| 32 | +static const char lwip2_version [] PROGMEM = "/lwIP:" STR(LWIP_VERSION_MAJOR) "." STR(LWIP_VERSION_MINOR) "." STR(LWIP_VERSION_REVISION); |
| 33 | +#endif |
| 34 | + |
| 35 | +String EspClass::getFullVersion() |
| 36 | +{ |
| 37 | + return String(F("SDK:")) + system_get_sdk_version() |
| 38 | + + F("/Core:") + FPSTR(arduino_esp8266_git_ver) |
| 39 | +#if LWIP_VERSION_MAJOR == 1 |
| 40 | + + F("/lwIP:") + String(LWIP_VERSION_MAJOR) + "." + String(LWIP_VERSION_MINOR) + "." + String(LWIP_VERSION_REVISION) |
| 41 | +#else |
| 42 | + + FPSTR(lwip2_version) |
| 43 | +#endif |
| 44 | +#if LWIP_VERSION_IS_DEVELOPMENT |
| 45 | + + F("-dev") |
| 46 | +#endif |
| 47 | +#if LWIP_VERSION_IS_RC |
| 48 | + + F("rc") + String(LWIP_VERSION_RC) |
| 49 | +#endif |
| 50 | +#ifdef LWIP_HASH_STR |
| 51 | + + "(" + F(LWIP_HASH_STR) + ")" |
| 52 | +#endif |
| 53 | + ; |
| 54 | +} |
0 commit comments