Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
examples
C
example.h
Go to the documentation of this file.
1
// License: Apache 2.0. See LICENSE file in root directory.
2
// Copyright(c) 2017 Intel Corporation. All Rights Reserved.
3
4
#include <
librealsense2/rs.h
>
5
#include <stdio.h>
6
#include <stdlib.h>
7
8
/* Function calls to librealsense may raise errors of type rs_error*/
9
void
check_error
(
rs2_error
*
e
)
10
{
11
if
(e)
12
{
13
printf(
"rs_error was raised when calling %s(%s):\n"
,
rs2_get_failed_function
(e),
rs2_get_failed_args
(e));
14
printf(
" %s\n"
,
rs2_get_error_message
(e));
15
exit
(EXIT_FAILURE);
16
}
17
}
18
19
void
print_device_info
(
rs2_device
*
dev
)
20
{
21
rs2_error
*
e
= 0;
22
printf(
"\nUsing device 0, an %s\n"
,
rs2_get_device_info
(dev,
RS2_CAMERA_INFO_NAME
, &e));
23
check_error
(e);
24
printf(
" Serial number: %s\n"
,
rs2_get_device_info
(dev,
RS2_CAMERA_INFO_SERIAL_NUMBER
, &e));
25
check_error
(e);
26
printf(
" Firmware version: %s\n\n"
,
rs2_get_device_info
(dev,
RS2_CAMERA_INFO_FIRMWARE_VERSION
, &e));
27
check_error
(e);
28
}
print_device_info
void print_device_info(rs2_device *dev)
Definition:
example.h:19
test-bad-conditions.dev
dev
Definition:
test-bad-conditions.py:16
RS2_CAMERA_INFO_SERIAL_NUMBER
Definition:
rs_sensor.h:24
rs2_error
Definition:
rs.cpp:139
RS2_CAMERA_INFO_NAME
Definition:
rs_sensor.h:23
check_error
void check_error(rs2_error *e)
Definition:
example.h:9
rmse.e
e
Definition:
rmse.py:177
rs.h
Exposes librealsense functionality for C compilers.
rs2_get_error_message
const char * rs2_get_error_message(const rs2_error *error)
Definition:
rs.cpp:1259
rs2_device
Definition:
api.h:28
RS2_CAMERA_INFO_FIRMWARE_VERSION
Definition:
rs_sensor.h:25
rs2::textual_icons::exit
static const textual_icon exit
Definition:
model-views.h:254
rs2_get_failed_function
const char * rs2_get_failed_function(const rs2_error *error)
Definition:
rs.cpp:1257
rs2_get_failed_args
const char * rs2_get_failed_args(const rs2_error *error)
Definition:
rs.cpp:1258
rs2_get_device_info
const char * rs2_get_device_info(const rs2_device *device, rs2_camera_info info, rs2_error **error)
Definition:
rs.cpp:703
librealsense2
Author(s): Sergey Dorodnicov
, Doron Hirshberg
, Mark Horn
, Reagan Lopez
, Itay Carpis
autogenerated on Mon May 3 2021 02:47:14