diff --git a/src/ds/d400/d400-device.cpp b/src/ds/d400/d400-device.cpp index c4fbe4b0ec..bdf6459696 100644 --- a/src/ds/d400/d400-device.cpp +++ b/src/ds/d400/d400-device.cpp @@ -657,7 +657,7 @@ namespace librealsense if (_fw_version >= firmware_version("5.6.3.0")) { - _is_locked = _ds_device_common->is_locked(GVD, is_camera_locked_offset); + _is_locked = _ds_device_common->is_locked( gvd_buff.data(), is_camera_locked_offset ); } if (_fw_version >= firmware_version("5.5.8.0")) diff --git a/src/ds/d500/d500-device.cpp b/src/ds/d500/d500-device.cpp index fb7a827e80..7a07111483 100644 --- a/src/ds/d500/d500-device.cpp +++ b/src/ds/d500/d500-device.cpp @@ -491,7 +491,7 @@ namespace librealsense pid_hex_str = rsutils::string::from() << std::uppercase << rsutils::string::hexdump( _pid ); - _is_locked = _ds_device_common->is_locked(GVD, is_camera_locked_offset); + _is_locked = _ds_device_common->is_locked( gvd_buff.data(), is_camera_locked_offset ); depth_sensor.register_option(RS2_OPTION_OUTPUT_TRIGGER_ENABLED, std::make_shared>(raw_depth_sensor, depth_xu, DS5_EXT_TRIGGER, diff --git a/src/ds/ds-device-common.cpp b/src/ds/ds-device-common.cpp index c6ad95632c..ab18bec174 100644 --- a/src/ds/ds-device-common.cpp +++ b/src/ds/ds-device-common.cpp @@ -115,9 +115,9 @@ namespace librealsense throw std::runtime_error("device not referenced in the product line"); } - bool ds_device_common::is_locked(uint8_t gvd_cmd, uint32_t offset) + bool ds_device_common::is_locked( const uint8_t * gvd_buff, uint32_t offset ) { - _is_locked = _hw_monitor->is_camera_locked(gvd_cmd, offset); + std::memcpy( &_is_locked, gvd_buff + offset, 1 ); return _is_locked; } diff --git a/src/ds/ds-device-common.h b/src/ds/ds-device-common.h index e6d4f8bd88..1526b00e14 100644 --- a/src/ds/ds-device-common.h +++ b/src/ds/ds-device-common.h @@ -30,7 +30,7 @@ namespace librealsense ds_device_common(device* ds_device, std::shared_ptr hwm) : _owner(ds_device), _hw_monitor(hwm), - _is_locked(false) + _is_locked(true) {} void enter_update_state() const; @@ -38,7 +38,7 @@ namespace librealsense void update_flash(const std::vector& image, rs2_update_progress_callback_sptr callback, int update_mode); bool is_camera_in_advanced_mode() const; - bool is_locked(uint8_t gvd_cmd, uint32_t offset); + bool is_locked( const uint8_t * gvd_buff, uint32_t offset ); void get_fw_details( const std::vector &gvd_buff, std::string& optic_serial, std::string& asic_serial, std::string& fwv ) const; private: diff --git a/src/hw-monitor.cpp b/src/hw-monitor.cpp index bcc2499e70..baa42792f5 100644 --- a/src/hw-monitor.cpp +++ b/src/hw-monitor.cpp @@ -241,13 +241,4 @@ namespace librealsense auto minSize = std::min(sz, data.size()); std::memcpy( gvd, data.data(), minSize ); } - - bool hw_monitor::is_camera_locked(uint8_t gvd_cmd, uint32_t offset) const - { - std::vector gvd(HW_MONITOR_BUFFER_SIZE); - get_gvd(gvd.size(), gvd.data(), gvd_cmd); - bool value; - std::memcpy( &value, gvd.data() + offset, 1 ); - return value; - } } diff --git a/src/hw-monitor.h b/src/hw-monitor.h index 39ae0d5693..ef5538e9e7 100644 --- a/src/hw-monitor.h +++ b/src/hw-monitor.h @@ -401,7 +401,6 @@ namespace librealsense } static std::string get_module_serial_string(const std::vector& buff, size_t index, size_t length = 6); - bool is_camera_locked(uint8_t gvd_cmd, uint32_t offset) const; template T get_gvd_field(const std::vector& data, size_t index)