// License: Apache 2.0. See LICENSE file in root directory. // Copyright(c) 2017 Intel Corporation. All Rights Reserved. #include #include #include /* Function calls to librealsense may raise errors of type rs_error*/ void check_error(rs2_error* e) { if (e) { printf("rs_error was raised when calling %s(%s):\n", rs2_get_failed_function(e), rs2_get_failed_args(e)); printf(" %s\n", rs2_get_error_message(e)); exit(EXIT_FAILURE); } } void print_device_info(rs2_device* dev) { rs2_error* e = 0; printf("\nUsing device 0, an %s\n", rs2_get_device_info(dev, RS2_CAMERA_INFO_NAME, &e)); check_error(e); printf(" Serial number: %s\n", rs2_get_device_info(dev, RS2_CAMERA_INFO_SERIAL_NUMBER, &e)); check_error(e); printf(" Firmware version: %s\n\n", rs2_get_device_info(dev, RS2_CAMERA_INFO_FIRMWARE_VERSION, &e)); check_error(e); }