l500-error-common.h
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2021 Intel Corporation. All Rights Reserved.
3 
4 #include "l500/l500-private.h"
5 
7 
8 std::map< uint8_t, std::pair< std::string, rs2_log_severity > > build_log_errors_map()
9 {
10  using namespace librealsense::ivcam2;
11 
12  std::map< uint8_t, std::pair< std::string, rs2_log_severity > > res;
13  l500_notifications_types last_index = success;
14  for (auto & i : l500_fw_error_report)
15  {
16  if (i.first == success)
17  continue; // LRS ignore if he get success as error
18 
19  REQUIRE(i.first > last_index);
20 
21  if (i.first > last_index + 1)
22  {
23  for (auto j = last_index + 1; j < i.first; j++)
24  {
25  std::stringstream s;
26  s << "L500 HW report - unresolved type " << j;
27  res[j] = { s.str(), RS2_LOG_SEVERITY_WARN };
28  }
29  }
30  res[i.first] = { i.second, RS2_LOG_SEVERITY_ERROR };
31  last_index = (l500_notifications_types)i.first;
32  }
33  return res;
34 }
35 
37 {
38  std::vector< uint8_t > raw_data( 24, 0 );
39  raw_data[0] = 0x14;
40  raw_data[2] = 0xab;
41  raw_data[3] = 0xcd;
42  raw_data[4] = l500_trigger_error_opcode;
43  raw_data[12] = num;
44 
45  if( auto debug = dev.as< debug_protocol >() )
46  {
47  try
48  {
49  debug.send_and_receive_raw_data( raw_data );
50  }
51  catch(std::exception const& e)
52  {
53  FAIL(e.what());
54  }
55  }
56 }
GLdouble s
std::map< uint8_t, std::pair< std::string, rs2_log_severity > > build_log_errors_map()
const uint8_t l500_trigger_error_opcode
unsigned char uint8_t
Definition: stdint.h:78
e
Definition: rmse.py:177
GLuint num
Definition: glext.h:5648
#define FAIL(...)
Definition: catch.hpp:17440
void trigger_error_or_exit(const rs2::device &dev, uint8_t num)
REQUIRE(n_callbacks==1)
const std::map< uint8_t, std::string > l500_fw_error_report
Definition: l500-private.h:291
GLint j
int i
GLuint res
Definition: glext.h:8856
T as() const
Definition: rs_device.hpp:129


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