Add tls_client example (#305)
* Add tls_client example This requires pico_mbedtls in the pico-sdk Connects to worldtimeapi.org and retrieves a web page Originally written by Floris Bos @maxnet
This commit is contained in:
44
pico_w/tls_client/CMakeLists.txt
Normal file
44
pico_w/tls_client/CMakeLists.txt
Normal file
@@ -0,0 +1,44 @@
|
||||
add_executable(picow_tls_client_background
|
||||
picow_tls_client.c
|
||||
)
|
||||
target_compile_definitions(picow_tls_client_background PRIVATE
|
||||
WIFI_SSID=\"${WIFI_SSID}\"
|
||||
WIFI_PASSWORD=\"${WIFI_PASSWORD}\"
|
||||
)
|
||||
target_include_directories(picow_tls_client_background PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
${CMAKE_CURRENT_LIST_DIR}/.. # for our common lwipopts
|
||||
)
|
||||
target_link_libraries(picow_tls_client_background
|
||||
pico_cyw43_arch_lwip_threadsafe_background
|
||||
pico_lwip_mbedtls
|
||||
pico_mbedtls
|
||||
pico_stdlib
|
||||
)
|
||||
pico_add_extra_outputs(picow_tls_client_background)
|
||||
|
||||
add_executable(picow_tls_client_poll
|
||||
picow_tls_client.c
|
||||
)
|
||||
target_compile_definitions(picow_tls_client_poll PRIVATE
|
||||
WIFI_SSID=\"${WIFI_SSID}\"
|
||||
WIFI_PASSWORD=\"${WIFI_PASSWORD}\"
|
||||
)
|
||||
target_include_directories(picow_tls_client_poll PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
${CMAKE_CURRENT_LIST_DIR}/.. # for our common lwipopts
|
||||
)
|
||||
target_link_libraries(picow_tls_client_poll
|
||||
pico_cyw43_arch_lwip_poll
|
||||
pico_lwip_mbedtls
|
||||
pico_mbedtls
|
||||
pico_stdlib
|
||||
)
|
||||
pico_add_extra_outputs(picow_tls_client_poll)
|
||||
|
||||
# Ignore warnings from lwip code
|
||||
set_source_files_properties(
|
||||
${PICO_LWIP_PATH}/src/apps/altcp_tls/altcp_tls_mbedtls.c
|
||||
PROPERTIES
|
||||
COMPILE_OPTIONS "-Wno-unused-result"
|
||||
)
|
||||
Reference in New Issue
Block a user