Skip to content

Commit

Permalink
Merge pull request #6557 from IntelRealSense/rc3
Browse files Browse the repository at this point in the history
v2.35.2 - Merge to development
  • Loading branch information
ev-mp authored Jun 9, 2020
2 parents a9b2615 + 91cc6c7 commit 8594d09
Show file tree
Hide file tree
Showing 26 changed files with 467 additions and 404 deletions.
13 changes: 10 additions & 3 deletions CMake/external_libcurl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ if(CHECK_FOR_UPDATES)
include(ExternalProject)
message(STATUS "Building libcurl enabled")

set(CURL_FLAGS -DBUILD_CURL_EXE=OFF -DBUILD_SHARED_LIBS=OFF -DUSE_WIN32_LDAP=OFF -DHTTP_ONLY=ON -DCURL_ZLIB=OFF -DCURL_DISABLE_CRYPTO_AUTH=ON -DCMAKE_USE_OPENSSL=OFF -DCMAKE_USE_LIBSSH2=OFF)
set(CURL_FLAGS -DBUILD_CURL_EXE=OFF -DBUILD_SHARED_LIBS=OFF -DUSE_WIN32_LDAP=OFF -DHTTP_ONLY=ON -DCURL_ZLIB=OFF -DCURL_DISABLE_CRYPTO_AUTH=ON -DCMAKE_USE_OPENSSL=OFF -DCMAKE_USE_LIBSSH2=OFF -DBUILD_TESTING=OFF )
if (WIN32)
set(CURL_FLAGS ${CURL_FLAGS} -DCURL_STATIC_CRT=ON )
endif()
Expand All @@ -14,10 +14,17 @@ if(CHECK_FOR_UPDATES)
GIT_TAG "53cdc2c963e33bc0cc1a51ad2df79396202e07f8" # curl-7_70_0
SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/third-party/libcurl
TEST_COMMAND ""
CMAKE_ARGS -DCMAKE_CXX_STANDARD_LIBRARIES=${CMAKE_CXX_STANDARD_LIBRARIES}
CMAKE_ARGS -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_C_FLAGS_DEBUG=${CMAKE_C_FLAGS_DEBUG}
-DCMAKE_C_FLAGS_MINSIZEREL=${CMAKE_C_FLAGS_MINSIZEREL}
-DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE}
-DCMAKE_C_FLAGS_RELWITHDEBINFO=${CMAKE_C_FLAGS_RELWITHDEBINFO}
-DCMAKE_CXX_STANDARD_LIBRARIES=${CMAKE_CXX_STANDARD_LIBRARIES}
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/libcurl/libcurl_install
-DCMAKE_INSTALL_LIBDIR=lib
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DANDROID_ABI=${ANDROID_ABI}
-DANDROID_STL=${ANDROID_STL} ${CURL_FLAGS}
)
Expand Down
14 changes: 14 additions & 0 deletions common/fw-update-helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@
#ifdef INTERNAL_FW
#include "common/fw/D4XX_FW_Image.h"
#include "common/fw/SR3XX_FW_Image.h"
#include "common/fw/L5XX_FW_Image.h"
#else
#define FW_D4XX_FW_IMAGE_VERSION ""
#define FW_SR3XX_FW_IMAGE_VERSION ""
#define FW_L5XX_FW_IMAGE_VERSION ""
const char* fw_get_D4XX_FW_Image(int) { return NULL; }
const char* fw_get_SR3XX_FW_Image(int) { return NULL; }
const char* fw_get_L5XX_FW_Image(int) { return NULL; }

#endif // INTERNAL_FW

constexpr const char* recommended_fw_url = "https://dev.intelrealsense.com/docs/firmware-releases";
Expand All @@ -46,6 +50,7 @@ namespace rs2
{
if (id == "D400") return RS2_PRODUCT_LINE_D400;
else if (id == "SR300") return RS2_PRODUCT_LINE_SR300;
else if (id == "L500") return RS2_PRODUCT_LINE_L500;
else return -1;
}

Expand All @@ -55,6 +60,7 @@ namespace rs2

if (product_line == RS2_PRODUCT_LINE_D400) return FW_D4XX_FW_IMAGE_VERSION;
//else if (product_line == RS2_PRODUCT_LINE_SR300) return FW_SR3XX_FW_IMAGE_VERSION;
else if (product_line == RS2_PRODUCT_LINE_L500) return FW_L5XX_FW_IMAGE_VERSION;
else return "";
}

Expand All @@ -80,6 +86,14 @@ namespace rs2
rv[RS2_PRODUCT_LINE_SR300] = vec;
}

if (strlen(FW_L5XX_FW_IMAGE_VERSION))
{
int size = 0;
auto hex = fw_get_L5XX_FW_Image(size);
auto vec = std::vector<uint8_t>(hex, hex + size);
rv[RS2_PRODUCT_LINE_L500] = vec;
}

return rv;
}

Expand Down
8 changes: 8 additions & 0 deletions common/fw/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ message(STATUS "T26X_FW_VERSION: ${T26X_FW_VERSION}")
set(T26X_FW_SHA1 c3940ccbb0e3045603e4aceaa2d73427f96e24bc)
set(T26X_FW_URL "${REALSENSE_FIRMWARE_URL}/Releases/TM2/FW/target/${T26X_FW_VERSION}")

string(REGEX MATCH "L5XX_RECOMMENDED_FIRMWARE_VERSION \"([0-9]+.[0-9]+.[0-9]+.[0-9]+)\"" _ ${ver})
set(L5XX_FW_VERSION ${CMAKE_MATCH_1})
message(STATUS "L5XX_FW_VERSION: ${L5XX_FW_VERSION}")
set(L5XX_FW_SHA1 5bb7d4e68994328f324559db66a0c586c3037afa)
set(L5XX_FW_URL "${REALSENSE_FIRMWARE_URL}/Releases/L5xx/FW")

add_library(${PROJECT_NAME} STATIC empty.c)

if (MSVC)
Expand Down Expand Up @@ -74,6 +80,8 @@ endfunction()
target_binary( "${D4XX_FW_URL}" "${D4XX_FW_VERSION}" "${D4XX_FW_SHA1}" D4XX_FW_Image .bin)
target_binary( "${SR3XX_FW_URL}" "${SR3XX_FW_VERSION}" "${SR3XX_FW_SHA1}" SR3XX_FW_Image .bin)
target_binary( "${T26X_FW_URL}" "${T26X_FW_VERSION}" "${T26X_FW_SHA1}" target .mvcmd)
target_binary( "${L5XX_FW_URL}" "${L5XX_FW_VERSION}" "${L5XX_FW_SHA1}" L5XX_FW_Image .bin)


install(TARGETS ${PROJECT_NAME} EXPORT realsense2Targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
Expand Down
1 change: 1 addition & 0 deletions common/fw/firmware-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
#define D4XX_RECOMMENDED_FIRMWARE_VERSION "5.12.5.0"
#define SR3XX_RECOMMENDED_FIRMWARE_VERSION "3.26.1.0"
#define T26X_FIRMWARE_VERSION "0.2.0.951"
#define L5XX_RECOMMENDED_FIRMWARE_VERSION "1.4.1.0"
1 change: 1 addition & 0 deletions common/fw/fw.rc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "D4XX_FW_Image.rc"
#include "SR3XX_FW_Image.rc"
#include "L5XX_FW_Image.rc"
#include "target.rc"
14 changes: 11 additions & 3 deletions common/model-views.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3252,7 +3252,7 @@ namespace rs2
{
for (auto&& n : related_notifications) n->dismiss(false);

_updates->remove_profile(_updates_profile);
_updates->set_device_status(_updates_profile, false);
}


Expand Down Expand Up @@ -4342,15 +4342,23 @@ namespace rs2
bool sw_update_required = updates_profile.retrieve_updates(versions_db_manager::LIBREALSENSE);
bool fw_update_required = updates_profile.retrieve_updates(versions_db_manager::FIRMWARE);

_updates_profile = updates_profile.get_update_profile();
updates_model::update_profile_model updates_profile_model(_updates_profile, ctx, this);

if (sw_update_required || fw_update_required)
{
_updates_profile = updates_profile.get_update_profile();
updates_model::update_profile_model updates_profile_model(updates_profile.get_update_profile(), ctx, this);
if (auto viewer_updates = updates_model_protected.lock())
{
viewer_updates->add_profile(updates_profile_model);
}
}
else
{ // For updating current device profile if exists (Could update firmware version)
if (auto viewer_updates = updates_model_protected.lock())
{
viewer_updates->update_profile(updates_profile_model);
}
}
}
catch (const std::exception& e)
{
Expand Down
2 changes: 1 addition & 1 deletion common/model-views.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ namespace rs2
static const textual_icon camera { u8"\uf030" };
static const textual_icon video_camera { u8"\uf03d" };
static const textual_icon edit { u8"\uf044" };
static const textual_icon check_square_o { u8"\uf046" };
static const textual_icon step_backward { u8"\uf048" };
static const textual_icon play { u8"\uf04b" };
static const textual_icon pause { u8"\uf04c" };
Expand All @@ -256,6 +255,7 @@ namespace rs2
static const textual_icon caret_down { u8"\uf0d7" };
static const textual_icon repeat { u8"\uf0e2" };
static const textual_icon circle { u8"\uf111" };
static const textual_icon check_square_o { u8"\uf14a" };
static const textual_icon cubes { u8"\uf1b3" };
static const textual_icon toggle_off { u8"\uf204" };
static const textual_icon toggle_on { u8"\uf205" };
Expand Down
40 changes: 22 additions & 18 deletions common/sw-update/dev-updates-profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,30 @@ namespace rs2
{
bool update_required(false);

std::map<versions_db_manager::version, update_description> &versions_vec((comp == versions_db_manager::FIRMWARE)?
_update_profile.firmware_versions : _update_profile.software_versions);

versions_db_manager::version &current_version((comp == versions_db_manager::FIRMWARE) ? _update_profile.firmware_version : _update_profile.software_version);
if (_update_profile.device_name.find("Recovery") == std::string::npos)
{
update_description experimental_update;
if (try_parse_update(_versions_db, _update_profile.device_name, versions_db_manager::EXPERIMENTAL, comp, experimental_update))
{
versions_vec[experimental_update.ver] = experimental_update;
}
update_description recommened_update;
if (try_parse_update(_versions_db, _update_profile.device_name, versions_db_manager::RECOMMENDED, comp, recommened_update))
{
versions_vec[recommened_update.ver] = recommened_update;
}
update_description required_update;
if (try_parse_update(_versions_db, _update_profile.device_name, versions_db_manager::ESSENTIAL, comp, required_update))
std::map<versions_db_manager::version, update_description> &versions_vec((comp == versions_db_manager::FIRMWARE) ?
_update_profile.firmware_versions : _update_profile.software_versions);

versions_db_manager::version &current_version((comp == versions_db_manager::FIRMWARE) ? _update_profile.firmware_version : _update_profile.software_version);
{
versions_vec[required_update.ver] = required_update;
update_required = update_required || (current_version < required_update.ver);
update_description experimental_update;
if (try_parse_update(_versions_db, _update_profile.device_name, versions_db_manager::EXPERIMENTAL, comp, experimental_update))
{
versions_vec[experimental_update.ver] = experimental_update;
}
update_description recommened_update;
if (try_parse_update(_versions_db, _update_profile.device_name, versions_db_manager::RECOMMENDED, comp, recommened_update))
{
versions_vec[recommened_update.ver] = recommened_update;
}
update_description required_update;
if (try_parse_update(_versions_db, _update_profile.device_name, versions_db_manager::ESSENTIAL, comp, required_update))
{
versions_vec[required_update.ver] = required_update;
// Ignore version zero as an indication of Recovery mode.
update_required = update_required || (current_version < required_update.ver);
}
}
}

Expand Down
4 changes: 4 additions & 0 deletions common/sw-update/dev-updates-profile.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ namespace rs2
std::map<versions_db_manager::version, update_description> firmware_versions;

device dev;
bool dev_active;

update_profile() :dev_active(true){};

};

explicit dev_updates_profile(const device& dev, const std::string &url, const bool use_url_as_local_path = false, http::user_callback_func_type download_callback = http::user_callback_func_type());
Expand Down
2 changes: 1 addition & 1 deletion common/sw-update/versions-db-manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace rs2
using namespace http;

// Get current platform
constexpr char* PLATFORM =
constexpr const char* PLATFORM =

#ifdef _WIN64
"Windows amd64";
Expand Down
Loading

0 comments on commit 8594d09

Please sign in to comment.