- void dhcps_lease_test(void) {
- struct dhcps_lease dhcp_lease;
- IP4_ADDR(&dhcp_lease.start_ip, 192, 168, 10, 10);
- IP4_ADDR(&dhcp_lease.end_ip, 192, 168, 10, 15);
- wifi_softap_set_dhcps_lease(&dhcp_lease);
- wifi_set_opmode(STATIONAP_MODE); //Set softAP + station mode
- wifi_softap_dhcps_stop();
- IP4_ADDR(&info.ip, 192, 168, 10, 1);
- IP4_ADDR(&info.gw, 192, 168, 10, 1);
- IP4_ADDR(&info.netmask, 255, 255, 255, 0);
- wifi_set_ip_info(SOFTAP_IF, &info);
- wifi_softap_dhcps_start();
Может надо какую библиотеку подключить? Пишет ошибка компиляции
Arduino: 1.8.5 (Windows 7), Плата:"Generic ESP8266 Module, 80 MHz, 40MHz, DIO, 115200, 1M (512K SPIFFS), ck, Disabled, None"
P:\WWW_Server\WWW_Server.ino: In function 'void dhcps_lease_test()':
WWW_Server:301: error: aggregate 'dhcps_lease_test()::dhcps_lease dhcp_lease' has incomplete type and cannot be defined
struct dhcps_lease dhcp_lease;
^
WWW_Server:302: error: 'IP4_ADDR' was not declared in this scope
IP4_ADDR(&dhcp_lease.start_ip, 192, 168, 10, 10);
^
WWW_Server:304: error: 'wifi_softap_set_dhcps_lease' was not declared in this scope
wifi_softap_set_dhcps_lease(&dhcp_lease);
^
P:\WWW_Server\WWW_Server.ino: In function 'void user_init()':
WWW_Server:308: error: aggregate 'user_init()::ip_info info' has incomplete type and cannot be defined
struct ip_info info;
^
WWW_Server:309: error: 'STATIONAP_MODE' was not declared in this scope
wifi_set_opmode(STATIONAP_MODE); //Set softAP + station mode
^
WWW_Server:309: error: 'wifi_set_opmode' was not declared in this scope
wifi_set_opmode(STATIONAP_MODE); //Set softAP + station mode
^
WWW_Server:310: error: 'wifi_softap_dhcps_stop' was not declared in this scope
wifi_softap_dhcps_stop();
^
WWW_Server:311: error: 'IP4_ADDR' was not declared in this scope
IP4_ADDR(&info.ip, 192, 168, 10, 1);
^
WWW_Server:314: error: 'SOFTAP_IF' was not declared in this scope
wifi_set_ip_info(SOFTAP_IF, &info);
^
WWW_Server:314: error: 'wifi_set_ip_info' was not declared in this scope
wifi_set_ip_info(SOFTAP_IF, &info);
^
WWW_Server:316: error: 'wifi_softap_dhcps_start' was not declared in this scope
wifi_softap_dhcps_start();
^
exit status 1
aggregate 'dhcps_lease_test()::dhcps_lease dhcp_lease' has incomplete type and cannot be defined
Этот отчёт будет иметь больше информации с
включенной опцией Файл -> Настройки ->
"Показать подробный вывод во время компиляции"