Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cmake flag for iot creds #2056

Merged
merged 2 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ project(KinesisVideoWebRTCClientSamples LANGUAGES C)

message("OPEN_SRC_INSTALL_PREFIX=${OPEN_SRC_INSTALL_PREFIX}")

if(IOT_CORE_ENABLE_CREDENTIALS)
add_definitions(-DIOT_CORE_ENABLE_CREDENTIALS)
message("Use IoT credentials in the samples")
endif()

if (WIN32)
if(NOT DEFINED PKG_CONFIG_EXECUTABLE)
if(EXISTS "C:\\gstreamer\\1.0\\x86_64\\bin\\pkg-config.exe")
Expand All @@ -17,7 +22,7 @@ if (WIN32)
message(FATAL_ERROR "Gstreamer not found in default path. Set the appropriate path with -DPKG_CONFIG_EXECUTABLE=<path>")
endif()
endif()

find_package(PkgConfig REQUIRED)

pkg_check_modules(GST gstreamer-1.0)
Expand Down
5 changes: 2 additions & 3 deletions samples/Samples.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,15 @@ extern "C" {

#define RTSP_PIPELINE_MAX_CHAR_COUNT 1000

/* To enable IoT credentials checks in the provided samples, specify
this through the CMake flag: cmake .. -DIOT_CORE_ENABLE_CREDENTIALS=ON */
#define IOT_CORE_CREDENTIAL_ENDPOINT ((PCHAR) "AWS_IOT_CORE_CREDENTIAL_ENDPOINT")
#define IOT_CORE_CERT ((PCHAR) "AWS_IOT_CORE_CERT")
#define IOT_CORE_PRIVATE_KEY ((PCHAR) "AWS_IOT_CORE_PRIVATE_KEY")
#define IOT_CORE_ROLE_ALIAS ((PCHAR) "AWS_IOT_CORE_ROLE_ALIAS")
#define IOT_CORE_THING_NAME ((PCHAR) "AWS_IOT_CORE_THING_NAME")
#define IOT_CORE_CERTIFICATE_ID ((PCHAR) "AWS_IOT_CORE_CERTIFICATE_ID")

/* Uncomment the following line in order to enable IoT credentials checks in the provided samples */
// #define IOT_CORE_ENABLE_CREDENTIALS 1

#define MASTER_DATA_CHANNEL_MESSAGE "This message is from the KVS Master"
#define VIEWER_DATA_CHANNEL_MESSAGE "This message is from the KVS Viewer"

Expand Down