Skip to content

Commit 8296e55

Browse files
committed
fix includes and add some comments
1 parent 2e312a6 commit 8296e55

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

src/fw-update/fw-update-device-interface.h

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// License: Apache 2.0. See LICENSE file in root directory.
2-
// Copyright(c) 2019 Intel Corporation. All Rights Reserved.
3-
2+
// Copyright(c) 2023 Intel Corporation. All Rights Reserved.
43
#pragma once
54

6-
#include "../types.h"
75
#include <src/core/device-interface.h>
8-
#include "../usb/usb-types.h"
9-
#include <cstddef>
6+
#include <librealsense2/hpp/rs_types.hpp>
7+
#include <cstdint>
8+
#include <vector>
9+
1010

1111
namespace librealsense
1212
{
@@ -16,20 +16,33 @@ namespace librealsense
1616
virtual bool check_fw_compatibility(const std::vector<uint8_t>& image) const = 0;
1717
};
1818

19+
// Regular devices inherit to enable entering DFU state or implementing unsigned FW update.
1920
class updatable : public firmware_check_interface
2021
{
2122
public:
23+
// Places the device in DFU (recovery) mode, where the DFU process can continue with update_device_interface.
24+
// Restarts the device!
2225
virtual void enter_update_state() const = 0;
23-
virtual std::vector<uint8_t> backup_flash( rs2_update_progress_callback_sptr callback) = 0;
24-
virtual void update_flash(const std::vector<uint8_t>& image, rs2_update_progress_callback_sptr callback, int update_mode) = 0;
26+
27+
// Returns a backup of the current flash image. Optional: return an empty buffer if unsupported
28+
virtual std::vector< uint8_t > backup_flash( rs2_update_progress_callback_sptr callback ) = 0;
29+
30+
// Unsigned FW update. When this is called, we're not in an "update state".
31+
virtual void update_flash( const std::vector< uint8_t > & image,
32+
rs2_update_progress_callback_sptr callback,
33+
int update_mode )
34+
= 0;
2535
};
2636

2737
MAP_EXTENSION( RS2_EXTENSION_UPDATABLE, updatable );
2838

39+
// Recovery devices implement this to perform DFU with signed FW.
2940
class update_device_interface : public device_interface, public firmware_check_interface
3041
{
3142
public:
32-
virtual void update(const void* fw_image, int fw_image_size, rs2_update_progress_callback_sptr = nullptr) const = 0;
43+
// Signed FW update
44+
virtual void update( const void * fw_image, int fw_image_size, rs2_update_progress_callback_sptr = nullptr ) const = 0;
45+
3346
protected:
3447
virtual const std::string& get_name() const = 0;
3548
virtual const std::string& get_product_line() const = 0;

0 commit comments

Comments
 (0)