From dc18454372bbf389ffae414c3ab7b906048674dd Mon Sep 17 00:00:00 2001 From: jebrando Date: Thu, 16 Aug 2018 14:14:09 -0700 Subject: [PATCH] Making minor fixes to the repo --- binary_info/CMakeLists.txt | 4 +++- binary_info/binary_info.c | 1 + binary_info/ll_sdk_client.c | 8 +++++++- script/execute_analysis.sh | 3 +++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/binary_info/CMakeLists.txt b/binary_info/CMakeLists.txt index f1b7bce..65d6b39 100644 --- a/binary_info/CMakeLists.txt +++ b/binary_info/CMakeLists.txt @@ -27,7 +27,9 @@ include_directories(${SDK_INCLUDE_DIRS}) add_executable(binary_info ${binary_info_c_files} ${binary_info_h_files}) target_link_libraries(binary_info aziotsharedutil iothub_client) -target_link_libraries(binary_info prov_device_client) +if (${use_prov_client}) + target_link_libraries(binary_info prov_device_client) +endif() add_subdirectory(lower_layer) add_subdirectory(upper_layer) diff --git a/binary_info/binary_info.c b/binary_info/binary_info.c index 247c539..7d28cb6 100644 --- a/binary_info/binary_info.c +++ b/binary_info/binary_info.c @@ -2,6 +2,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. #include #include +#include #include "azure_c_shared_utility/strings.h" #include "mem_reporter.h" diff --git a/binary_info/ll_sdk_client.c b/binary_info/ll_sdk_client.c index c67736d..00c77be 100644 --- a/binary_info/ll_sdk_client.c +++ b/binary_info/ll_sdk_client.c @@ -33,7 +33,7 @@ /* String containing Hostname, Device Id & Device Key in the format: */ /* Paste in the your iothub connection string */ -static const char* connectionString = "HostName=;DeviceId=;SharedAccessKey="; +static const char* connectionString = ""; #define MESSAGE_COUNT 1 static bool g_continueRunning = true; @@ -66,6 +66,12 @@ int main(void) size_t messages_sent = 0; const char* telemetry_msg = "test_message"; + if (strlen(connectionString) == 0) + { + // Attempt to get the connection string from the environment + connectionString = getenv("IOTHUB_CONNECTION_STRING"); + } + // Select the Protocol to use with the connection #ifdef USE_AMQP #ifdef USE_WEB_SOCKETS diff --git a/script/execute_analysis.sh b/script/execute_analysis.sh index 30e001e..5711c8f 100755 --- a/script/execute_analysis.sh +++ b/script/execute_analysis.sh @@ -28,6 +28,9 @@ let VSPACE=${MEMAR[0]}+${MEMAR[1]} make --jobs=$CORES +# Run strip from the binaries +./binary_info/lower_layer/ + # Run the analysis applications ./binary_info/binary_info -c $cmake_folder ./memory/telemetry_memory/telemetry_memory -c $IOTHUB_CONNECTION_STRING