forked from esp8266/Arduino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request esp8266#573 from probonopd/patch-2
Example sketch for Espressif ESP8266 SDK functionality
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
hardware/esp8266com/esp8266/libraries/esp8266/examples/CallSDKFunctions/CallSDKFunctions.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
/* | ||
* NativeSdk by Simon Peter | ||
* Access functionality from the Espressif ESP8266 SDK | ||
* This example code is in the public domain | ||
* | ||
* This is for advanced users. | ||
* Note that this makes your code dependent on the ESP8266, which is generally | ||
* a bad idea. So you should try to use esp8266/Arduino functionality | ||
* where possible instead, in order to abstract away the hardware dependency. | ||
*/ | ||
|
||
// Expose Espressif SDK functionality - wrapped in ifdef so that it still | ||
// compiles on other platforms | ||
#ifdef ESP8266 | ||
extern "C" { | ||
#include "user_interface.h" | ||
} | ||
#endif | ||
|
||
void setup() { | ||
Serial.begin(115200); | ||
} | ||
|
||
void loop() { | ||
// Call Espressif SDK functionality - wrapped in ifdef so that it still | ||
// compiles on other platforms | ||
#ifdef ESP8266 | ||
Serial.print("wifi_station_get_hostname: "); | ||
Serial.println(wifi_station_get_hostname()); | ||
#endif | ||
delay(1000); | ||
} |