device_list.cpp
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2019 Intel Corporation. All Rights Reserved.
3 
4 #include <jni.h>
5 #include "error.h"
6 
7 #include "../../../include/librealsense2/rs.h"
8 
9 extern "C" JNIEXPORT jint JNICALL
11  jlong handle) {
12  rs2_error *e = NULL;
13  auto rv = rs2_get_device_count(reinterpret_cast<const rs2_device_list *>(handle), &e);
14  handle_error(env, e);
15  return rv;
16 }
17 
18 extern "C" JNIEXPORT jlong JNICALL
20  jlong handle, jint index) {
21  rs2_error *e = NULL;
22  rs2_device* rv = rs2_create_device(reinterpret_cast<const rs2_device_list *>(handle), index, &e);
23  handle_error(env, e);
24  return (jlong)rv;
25 }
26 
27 extern "C" JNIEXPORT jboolean JNICALL
29  jlong handle, jlong deviceHandle) {
30  rs2_error *e = NULL;
31  auto rv = rs2_device_list_contains(reinterpret_cast<const rs2_device_list *>(handle),
32  reinterpret_cast<const rs2_device *>(deviceHandle), &e);
33  handle_error(env, e);
34  return rv > 0;
35 }
36 
37 extern "C" JNIEXPORT void JNICALL
40 }
int rs2_device_list_contains(const rs2_device_list *info_list, const rs2_device *device, rs2_error **error)
Definition: rs.cpp:890
JNIEXPORT jlong JNICALL Java_com_intel_realsense_librealsense_DeviceList_nCreateDevice(JNIEnv *env, jclass type, jlong handle, jint index)
Definition: device_list.cpp:19
GLuint64 GLenum void * handle
Definition: glext.h:7785
rs2_device * rs2_create_device(const rs2_device_list *info_list, int index, rs2_error **error)
Definition: rs.cpp:289
void handle_error(JNIEnv *env, rs2_error *error)
Definition: error.cpp:6
e
Definition: rmse.py:177
GLuint index
JNIEXPORT jboolean JNICALL Java_com_intel_realsense_librealsense_DeviceList_nContainsDevice(JNIEnv *env, jclass type, jlong handle, jlong deviceHandle)
Definition: device_list.cpp:28
Definition: api.h:28
GLenum type
#define NULL
Definition: tinycthread.c:47
JNIEXPORT void JNICALL Java_com_intel_realsense_librealsense_DeviceList_nRelease(JNIEnv *env, jclass type, jlong handle)
Definition: device_list.cpp:38
void rs2_delete_device_list(rs2_device_list *info_list)
Definition: rs.cpp:275
int rs2_get_device_count(const rs2_device_list *info_list, rs2_error **error)
Definition: rs.cpp:259
JNIEXPORT jint JNICALL Java_com_intel_realsense_librealsense_DeviceList_nGetDeviceCount(JNIEnv *env, jclass type, jlong handle)
Definition: device_list.cpp:10


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