Improve ap example (#233)
* Add dns server The access point example is a bit complicated to use as you have to open a browser and enter a url with the IP address of the device Add a simple dns server that can be used to make the access point behave like a captive portal. All DNS requests point back to the gateway IP. * Improve AP example The web page /ledtest gives you a web page with an option to turn the led on and off Start the DNS server and redirect all HTTP requests to this page. Improve the code so it can handle more than one request at a time. Fixes: #232
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
add_executable(picow_access_point_background
|
||||
picow_access_point.c
|
||||
dhcpserver/dhcpserver.c
|
||||
dnsserver/dnsserver.c
|
||||
)
|
||||
|
||||
target_include_directories(picow_access_point_background PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
${CMAKE_CURRENT_LIST_DIR}/.. # for our common lwipopts
|
||||
${CMAKE_CURRENT_LIST_DIR}/dhcpserver
|
||||
${CMAKE_CURRENT_LIST_DIR}/dnsserver
|
||||
)
|
||||
|
||||
target_link_libraries(picow_access_point_background
|
||||
@@ -19,15 +21,16 @@ pico_add_extra_outputs(picow_access_point_background)
|
||||
add_executable(picow_access_point_poll
|
||||
picow_access_point.c
|
||||
dhcpserver/dhcpserver.c
|
||||
dnsserver/dnsserver.c
|
||||
)
|
||||
target_include_directories(picow_access_point_poll PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
${CMAKE_CURRENT_LIST_DIR}/.. # for our common lwipopts
|
||||
${CMAKE_CURRENT_LIST_DIR}/dhcpserver
|
||||
${CMAKE_CURRENT_LIST_DIR}/dnsserver
|
||||
)
|
||||
target_link_libraries(picow_access_point_poll
|
||||
pico_cyw43_arch_lwip_poll
|
||||
pico_stdlib
|
||||
)
|
||||
pico_add_extra_outputs(picow_access_point_poll)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user