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*/
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 
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 }
void print_device_info(rs2_device *dev)
Definition: example.h:19
void check_error(rs2_error *e)
Definition: example.h:9
e
Definition: rmse.py:177
Exposes librealsense functionality for C compilers.
const char * rs2_get_error_message(const rs2_error *error)
Definition: rs.cpp:1259
Definition: api.h:28
static const textual_icon exit
Definition: model-views.h:254
const char * rs2_get_failed_function(const rs2_error *error)
Definition: rs.cpp:1257
const char * rs2_get_failed_args(const rs2_error *error)
Definition: rs.cpp:1258
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