Is there a published #define that can be used to implicitly determine the version of the SDK that is being used during compilation time?
I could imagine something like
#define ESP_SDK_VERSION "1.4.0"
being present ... and was curious if such a technique was already present in the SDK?
Neil
Can we determine SDK version at compile time?
Re: Can we determine SDK version at compile time?
Postby tve » Wed Sep 30, 2015 12:53 pm
It's available at run-time: system_get_sdk_version();
For Esprunio users there's:

For Esprunio users there's:
Code: Select all
>ESP8266WiFi.getState();
={
"sdkVersion": "1.4.0",
"cpuFrequency": 80, "freeHeap": 1520, "maxCon": 5 }

Re: Can we determine SDK version at compile time?
Postby kolban » Wed Sep 30, 2015 1:12 pm
@tve
Thanks for that. That's good to know.
I was more thinking of the notion of compilation determination between SDK releases. It is probably a safe bet to assume that there will be future SDK releases which will change or add or remove APIs. If one wanted to create an application that would still compile cleanly against known SDK releases, it might be useful to know (at compile time), the release of SDK being compiled against.
It would be nice to assume that every future SDK release will always be backwards compatible with the last but I am more thinking about forward compatibility. For example, when a new release ships, it would be great to allow applications to compile against it ... but I would prefer to also provide support for the previous SDK (the one that we know works ... for example) ... and on occasion, the only way to achieve that is by knowing at compile time, the SDK level.
A concrete example would be "os_realloc" ... or your own experience with the 1st item in a scan callback list. These appear to diverge between releases.
Thanks for that. That's good to know.
I was more thinking of the notion of compilation determination between SDK releases. It is probably a safe bet to assume that there will be future SDK releases which will change or add or remove APIs. If one wanted to create an application that would still compile cleanly against known SDK releases, it might be useful to know (at compile time), the release of SDK being compiled against.
It would be nice to assume that every future SDK release will always be backwards compatible with the last but I am more thinking about forward compatibility. For example, when a new release ships, it would be great to allow applications to compile against it ... but I would prefer to also provide support for the previous SDK (the one that we know works ... for example) ... and on occasion, the only way to achieve that is by knowing at compile time, the SDK level.
A concrete example would be "os_realloc" ... or your own experience with the 1st item in a scan callback list. These appear to diverge between releases.
Who is online
Users browsing this forum: No registered users and 27 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.