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

Move FW version & serial numbers parsing to ds-common #11474

Merged
merged 1 commit into from
Feb 23, 2023
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
12 changes: 5 additions & 7 deletions src/ds/d400/d400-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint8_t> &gvd_buf ) const
{
using namespace ds;
std::array<unsigned char,HW_MONITOR_BUFFER_SIZE> gvd_buf;
_hw_monitor->get_gvd(gvd_buf.size(), gvd_buf.data(), GVD);

// Opaque retrieval
d400_caps val{d400_caps::CAP_UNDEFINED};
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/ds/d400/d400-device.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint8_t> &gvd_buf ) const;

//TODO - add these to device class as pure virtual methods
command get_firmware_logs_command() const;
Expand Down
7 changes: 7 additions & 0 deletions src/ds/ds-device-common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ namespace librealsense
return _is_locked;
}

void ds_device_common::get_fw_details( const std::vector<uint8_t> &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<uint8_t> ds_device_common::backup_flash(update_progress_callback_ptr callback)
{
int flash_size = 1024 * 2048;
Expand Down
1 change: 1 addition & 0 deletions src/ds/ds-device-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint8_t> &gvd_buff, std::string& optic_serial, std::string& asic_serial, std::string& fwv ) const;

private:
uvc_sensor& get_raw_depth_sensor();
Expand Down