|
1 | | -# Standalone example that reads from the on board temperature sensor and sends notifications via BLE |
2 | | -# Flashes slowly each second to show it's running |
3 | | -add_executable(picow_ble_temp_sensor |
4 | | - server.c server_common.c |
5 | | - ) |
6 | | -target_link_libraries(picow_ble_temp_sensor |
7 | | - pico_stdlib |
8 | | - pico_btstack_ble |
9 | | - pico_btstack_cyw43 |
10 | | - pico_cyw43_arch_none |
11 | | - hardware_adc |
12 | | - ) |
13 | | -target_include_directories(picow_ble_temp_sensor PRIVATE |
14 | | - ${CMAKE_CURRENT_LIST_DIR} # For btstack config |
15 | | - ) |
16 | | -pico_btstack_make_gatt_header(picow_ble_temp_sensor PRIVATE "${CMAKE_CURRENT_LIST_DIR}/temp_sensor.gatt") |
17 | | - |
18 | | -pico_add_extra_outputs(picow_ble_temp_sensor) |
19 | | -example_auto_set_url(picow_ble_temp_sensor) |
20 | | - |
21 | | -# Standalone example that connects to picow_ble_temp_sensor and reads the temperature |
22 | | -# Flahes once quickly each second when it's running but not connected to another device |
23 | | -# Flashes twice quickly each second when connected to another device and reading it's temperature |
24 | | -add_executable(picow_ble_temp_reader |
25 | | - client.c |
26 | | - ) |
27 | | -target_link_libraries(picow_ble_temp_reader |
28 | | - pico_stdlib |
29 | | - pico_btstack_ble |
30 | | - pico_btstack_cyw43 |
31 | | - pico_cyw43_arch_none |
32 | | - hardware_adc |
33 | | - ) |
34 | | -target_include_directories(picow_ble_temp_reader PRIVATE |
35 | | - ${CMAKE_CURRENT_LIST_DIR} # For btstack config |
36 | | - ) |
37 | | -target_compile_definitions(picow_ble_temp_reader PRIVATE |
38 | | - RUNNING_AS_CLIENT=1 |
39 | | -) |
40 | | - |
41 | | -pico_add_extra_outputs(picow_ble_temp_reader) |
42 | | -example_auto_set_url(picow_ble_temp_reader) |
43 | | - |
44 | | -if (WIFI_SSID AND WIFI_PASSWORD) |
45 | | - # Another version of the sensor example, but this time also runs iperf over wifi |
46 | | - add_executable(picow_ble_temp_sensor_with_wifi |
47 | | - server_with_wifi.c server_common.c |
48 | | - ) |
49 | | - target_link_libraries(picow_ble_temp_sensor_with_wifi |
50 | | - pico_stdlib |
51 | | - pico_btstack_ble |
52 | | - pico_btstack_cyw43 |
53 | | - pico_cyw43_arch_lwip_threadsafe_background |
54 | | - pico_lwip_iperf |
55 | | - hardware_adc |
56 | | - ) |
57 | | - target_include_directories(picow_ble_temp_sensor_with_wifi PRIVATE |
58 | | - ${CMAKE_CURRENT_LIST_DIR} # For btstack config |
59 | | - ) |
60 | | - target_compile_definitions(picow_ble_temp_sensor_with_wifi PRIVATE |
61 | | - WIFI_SSID=\"${WIFI_SSID}\" |
62 | | - WIFI_PASSWORD=\"${WIFI_PASSWORD}\" |
63 | | - ) |
64 | | - pico_btstack_make_gatt_header(picow_ble_temp_sensor_with_wifi PRIVATE "${CMAKE_CURRENT_LIST_DIR}/temp_sensor.gatt") |
65 | | - |
66 | | - pico_add_extra_outputs(picow_ble_temp_sensor_with_wifi) |
67 | | - example_auto_set_url(picow_ble_temp_sensor_with_wifi) |
68 | | -endif() |
| 1 | +add_subdirectory(client) |
| 2 | +add_subdirectory(server) |
0 commit comments