sr300-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 
5 #include "ivcam-private.h"
6 #include <chrono>
7 #include <thread>
8 
9 namespace librealsense
10 {
11  sr300_update_device::sr300_update_device(std::shared_ptr<context> ctx, bool register_device_notifications, std::shared_ptr<platform::usb_device> usb_device)
12  : update_device(ctx, register_device_notifications, usb_device), _name("Intel RealSense SR300 Recovery"), _product_line("SR300")
13  {
15  }
16 
17  void sr300_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  // wait for the device to come back from recovery state, TODO: check cause
22  std::this_thread::sleep_for(std::chrono::seconds(10));
23  }
24 
25  std::string sr300_update_device::parse_serial_number(const std::vector<uint8_t>& buffer) const
26  {
27  if (buffer.size() != sizeof(serial_number_data))
28  throw std::runtime_error("DFU - failed to parse serial number!");
29 
30  std::stringstream rv;
31  for (auto i = 0; i < ivcam::module_serial_size; i++)
32  rv << std::setfill('0') << std::setw(2) << std::hex << static_cast<int>(buffer[i]);
33 
34  return rv.str();
35  }
36 }
virtual void update(const void *fw_image, int fw_image_size, update_progress_callback_ptr=nullptr) const override
sr300_update_device(std::shared_ptr< context > ctx, bool register_device_notifications, std::shared_ptr< platform::usb_device > usb_device)
GLsizei const GLchar *const * string
GLenum GLfloat * buffer
std::shared_ptr< rs2_update_progress_callback > update_progress_callback_ptr
Definition: src/types.h:1077
std::string parse_serial_number(const std::vector< uint8_t > &buffer) const
def callback(frame)
Definition: t265_stereo.py:91
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:50:10