esp8266ndn
NDN Arduino library for ESP8266 and more
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
autoconfig.hpp
Go to the documentation of this file.
1 #ifndef ESP8266NDN_APP_AUTOCONFIG_HPP
2 #define ESP8266NDN_APP_AUTOCONFIG_HPP
3 
4 #if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_RP2040)
5 
6 #include <IPAddress.h>
7 #include <WString.h>
8 
9 #if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_RP2040)
10 #define ESP8266NDN_Network WiFi
11 #define ESP8266NDN_NetworkClient WiFiClient
12 #elif defined(ARDUINO_ARCH_ESP32)
13 #define ESP8266NDN_Network Network
14 #define ESP8266NDN_NetworkClient NetworkClient
15 #endif
16 
18 
19 #if defined(ARDUINO_ARCH_RP2040)
20 using arduino::IPAddress;
21 using arduino::String;
22 #endif
23 
24 namespace esp8266ndn {
25 
26 struct FchResponse {
27  bool ok = false;
28  IPAddress ip;
29 };
30 
38 fchQuery(ESP8266NDN_NetworkClient& client, String serviceUri = "https://fch.ndn.today/");
39 
40 } // namespace esp8266ndn
41 
42 #endif // defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
43 
44 #endif // ESP8266NDN_APP_AUTOCONFIG_HPP
#define ESP8266NDN_NetworkClient
Definition: autoconfig.hpp:14
Definition: autoconfig.hpp:24
FchResponse fchQuery(ESP8266NDN_NetworkClient &client, String serviceUri="https://fch.ndn.today/")
Query NDN-FCH service to find a nearby NDN router.
Definition: autoconfig.hpp:26
bool ok
Definition: autoconfig.hpp:27
IPAddress ip
Definition: autoconfig.hpp:28