ds5-fw-update-device.cpp
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2019 Intel Corporation. All Rights Reserved.
3 
4 #include "ds5-fw-update-device.h"
5 #include "ds5-private.h"
6 
7 namespace librealsense
8 {
9  ds_update_device::ds_update_device(std::shared_ptr<context> ctx, bool register_device_notifications, std::shared_ptr<platform::usb_device> usb_device)
10  : update_device(ctx, register_device_notifications, usb_device), _product_line("D400")
11  {
12  auto info = usb_device->get_info();
13  _name = ds::rs400_sku_names.find(info.pid) != ds::rs400_sku_names.end() ? ds::rs400_sku_names.at(info.pid) : "unknown";
15  }
16 
17  void ds_update_device::update(const void* fw_image, int fw_image_size, update_progress_callback_ptr callback) const
18  {
19  update_device::update(fw_image, fw_image_size, callback);
20  }
21 
22  std::string ds_update_device::parse_serial_number(const std::vector<uint8_t>& buffer) const
23  {
24  if (buffer.size() != sizeof(serial_number_data))
25  throw std::runtime_error("DFU - failed to parse serial number!");
26 
27  std::stringstream rv;
28  for (auto i = 0; i < ds::module_serial_size; i++)
29  rv << std::setfill('0') << std::setw(2) << std::hex << static_cast<int>(buffer[i]);
30 
31  return rv.str();
32  }
33 }
GLsizei const GLchar *const * string
GLenum GLfloat * buffer
std::shared_ptr< rs2_update_progress_callback > update_progress_callback_ptr
Definition: src/types.h:1077
def info(name, value, persistent=False)
Definition: test.py:301
std::string parse_serial_number(const std::vector< uint8_t > &buffer) const
static const std::map< std::uint16_t, std::string > rs400_sku_names
Definition: ds5-private.h:128
def callback(frame)
Definition: t265_stereo.py:91
void update(const void *fw_image, int fw_image_size, update_progress_callback_ptr=nullptr) const override
ds_update_device(std::shared_ptr< context > ctx, bool register_device_notifications, std::shared_ptr< platform::usb_device > usb_device)
virtual void update(const void *fw_image, int fw_image_size, update_progress_callback_ptr=nullptr) const override
std::vector< uint8_t > _serial_number_buffer
int i


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:12