diff --git a/src/ds/d400/d400-device.cpp b/src/ds/d400/d400-device.cpp index 4b0c76cd71..93a0f36a43 100644 --- a/src/ds/d400/d400-device.cpp +++ b/src/ds/d400/d400-device.cpp @@ -414,11 +414,9 @@ namespace librealsense return {}; } - ds::d400_caps d400_device::parse_device_capabilities() const + ds::d400_caps d400_device::parse_device_capabilities( const std::vector &gvd_buf ) const { using namespace ds; - std::array gvd_buf; - _hw_monitor->get_gvd(gvd_buf.size(), gvd_buf.data(), GVD); // Opaque retrieval d400_caps val{d400_caps::CAP_UNDEFINED}; @@ -584,14 +582,14 @@ namespace librealsense _hw_monitor->get_gvd(gvd_buff.size(), gvd_buff.data(), GVD); - optic_serial = _hw_monitor->get_module_serial_string(gvd_buff, module_serial_offset); - asic_serial = _hw_monitor->get_module_serial_string(gvd_buff, module_asic_serial_offset); - auto fwv = _hw_monitor->get_firmware_version_string(gvd_buff, camera_fw_version_offset); + std::string fwv; + _ds_device_common->get_fw_details( gvd_buff, optic_serial, asic_serial, fwv ); + _fw_version = firmware_version(fwv); _recommended_fw_version = firmware_version(D4XX_RECOMMENDED_FIRMWARE_VERSION); if (_fw_version >= firmware_version("5.10.4.0")) - _device_capabilities = parse_device_capabilities(); + _device_capabilities = parse_device_capabilities( gvd_buff ); //D457 Development advanced_mode = is_camera_in_advanced_mode(); diff --git a/src/ds/d400/d400-device.h b/src/ds/d400/d400-device.h index d1dc8c0495..be501d4f23 100644 --- a/src/ds/d400/d400-device.h +++ b/src/ds/d400/d400-device.h @@ -73,7 +73,7 @@ namespace librealsense float get_stereo_baseline_mm() const; - ds::d400_caps parse_device_capabilities() const; + ds::d400_caps parse_device_capabilities( const std::vector &gvd_buf ) const; //TODO - add these to device class as pure virtual methods command get_firmware_logs_command() const; diff --git a/src/ds/ds-device-common.cpp b/src/ds/ds-device-common.cpp index a65a9e294d..f0e992d390 100644 --- a/src/ds/ds-device-common.cpp +++ b/src/ds/ds-device-common.cpp @@ -121,6 +121,13 @@ namespace librealsense return _is_locked; } + void ds_device_common::get_fw_details( const std::vector &gvd_buff, std::string& optic_serial, std::string& asic_serial, std::string& fwv ) const + { + optic_serial = _hw_monitor->get_module_serial_string(gvd_buff, module_serial_offset); + asic_serial = _hw_monitor->get_module_serial_string(gvd_buff, module_asic_serial_offset); + fwv = _hw_monitor->get_firmware_version_string(gvd_buff, camera_fw_version_offset); + } + std::vector ds_device_common::backup_flash(update_progress_callback_ptr callback) { int flash_size = 1024 * 2048; diff --git a/src/ds/ds-device-common.h b/src/ds/ds-device-common.h index ad6fd722fc..625bba6365 100644 --- a/src/ds/ds-device-common.h +++ b/src/ds/ds-device-common.h @@ -39,6 +39,7 @@ namespace librealsense bool is_camera_in_advanced_mode() const; bool is_locked(uint8_t gvd_cmd, 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: uvc_sensor& get_raw_depth_sensor();