Skip to content

Commit 04e897b

Browse files
committed
fix(mosq): Add new ci target for esp-peer
1 parent 25671a6 commit 04e897b

File tree

5 files changed

+33
-3
lines changed

5 files changed

+33
-3
lines changed

components/mosquitto/examples/serverless_mqtt/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ cmake_minimum_required(VERSION 3.16)
44

55
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
66

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)
710
execute_process(COMMAND ${CMAKE_BINARY_DIR}/../esp_peer_setup.sh
811
${CMAKE_BINARY_DIR}
912
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
@@ -12,7 +15,7 @@ execute_process(COMMAND ${CMAKE_BINARY_DIR}/../esp_peer_setup.sh
1215
if(script_result)
1316
message(FATAL_ERROR "Script esp_peer_setup.sh failed with exit code ${script_result}")
1417
endif()
15-
1618
list(APPEND EXTRA_COMPONENT_DIRS "${CMAKE_BINARY_DIR}/esp-peer/components/")
19+
endif()
1720

1821
project(serverless_mqtt)
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
if(CONFIG_EXAMPLE_PEER_LIB_ESP_PEER)
2+
set(PEER_BACKEND_SRC "webrtc.c")
3+
endif()
4+
15
idf_component_register(SRCS "serverless_mqtt.c"
26
"wifi_connect.c"
3-
"webrtc.c"
7+
"${PEER_BACKEND_SRC}"
48
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()

components/mosquitto/examples/serverless_mqtt/main/Kconfig.projbuild

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,19 @@ menu "Example Configuration"
8282
bool "peer2"
8383
endchoice
8484

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+
85100
endmenu
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CONFIG_EXAMPLE_PEER_LIB_ESP_PEER=n
2+
CONFIG_EXAMPLE_PEER_LIB_LIBJUICE=y
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CONFIG_IDF_TARGET="esp32s3"
2+
CONFIG_EXAMPLE_PEER_LIB_ESP_PEER=y
3+
CONFIG_EXAMPLE_PEER_LIB_LIBJUICE=n

0 commit comments

Comments
 (0)