File tree Expand file tree Collapse file tree 5 files changed +33
-3
lines changed
components/mosquitto/examples/serverless_mqtt Expand file tree Collapse file tree 5 files changed +33
-3
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,9 @@ cmake_minimum_required(VERSION 3.16)
4
4
5
5
include ($ENV{IDF_PATH} /tools/cmake/project.cmake )
6
6
7
+ # Setup ESP-PEER from GitHub repo (but it's supported only on certain targets)
8
+ set (ESP_PEER_COMPATIBLE_TARGETS "esp32s2" "esp32s3" "esp32p4" "esp32" )
9
+ if (IDF_TARGET IN_LIST ESP_PEER_COMPATIBLE_TARGETS )
7
10
execute_process (COMMAND ${CMAKE_BINARY_DIR} /../esp_peer_setup.sh
8
11
${CMAKE_BINARY_DIR}
9
12
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
@@ -12,7 +15,7 @@ execute_process(COMMAND ${CMAKE_BINARY_DIR}/../esp_peer_setup.sh
12
15
if (script_result )
13
16
message (FATAL_ERROR "Script esp_peer_setup.sh failed with exit code ${script_result} " )
14
17
endif ()
15
-
16
18
list (APPEND EXTRA_COMPONENT_DIRS "${CMAKE_BINARY_DIR} /esp-peer/components/" )
19
+ endif ()
17
20
18
21
project (serverless_mqtt )
Original file line number Diff line number Diff line change
1
+ if (CONFIG_EXAMPLE_PEER_LIB_ESP_PEER )
2
+ set (PEER_BACKEND_SRC "webrtc.c" )
3
+ endif ()
4
+
1
5
idf_component_register (SRCS "serverless_mqtt.c"
2
6
"wifi_connect.c"
3
- "webrtc.c "
7
+ "${PEER_BACKEND_SRC} "
4
8
INCLUDE_DIRS "."
5
- REQUIRES libjuice nvs_flash mqtt json esp_wifi media_lib_sal esp_webrtc peer_default )
9
+ REQUIRES libjuice nvs_flash mqtt json esp_wifi )
10
+ if (CONFIG_EXAMPLE_PEER_LIB_ESP_PEER )
11
+ idf_component_optional_requires (PUBLIC media_lib_sal esp_webrtc peer_default )
12
+ endif ()
Original file line number Diff line number Diff line change @@ -82,4 +82,19 @@ menu "Example Configuration"
82
82
bool "peer2"
83
83
endchoice
84
84
85
+ choice EXAMPLE_PEER_LIB
86
+ prompt "Choose peer library"
87
+ default EXAMPLE_PEER_LIB_LIBJUICE
88
+ help
89
+ Choose the peer library to use for WebRTC communication.
90
+ libjuice: Use libjuice library for ICE/STUN/TURN (Performs manual signalling)
91
+ esp_peer: Use ESP-IDF specific peer library
92
+
93
+ config EXAMPLE_PEER_LIB_ESP_PEER
94
+ bool "esp_peer"
95
+
96
+ config EXAMPLE_PEER_LIB_LIBJUICE
97
+ bool "libjuice"
98
+ endchoice
99
+
85
100
endmenu
Original file line number Diff line number Diff line change
1
+ CONFIG_EXAMPLE_PEER_LIB_ESP_PEER=n
2
+ CONFIG_EXAMPLE_PEER_LIB_LIBJUICE=y
Original file line number Diff line number Diff line change
1
+ CONFIG_IDF_TARGET="esp32s3"
2
+ CONFIG_EXAMPLE_PEER_LIB_ESP_PEER=y
3
+ CONFIG_EXAMPLE_PEER_LIB_LIBJUICE=n
You can’t perform that action at this time.
0 commit comments