DeviceList.java
Go to the documentation of this file.
1 package com.intel.realsense.librealsense;
2 
3 import android.util.Log;
4 
5 public class DeviceList extends LrsClass {
6  private static final String TAG = "librs api";
7 
8  public DeviceList(long handle){
9  mHandle = handle;
10  }
11 
12  public int getDeviceCount(){
13  return nGetDeviceCount(mHandle);
14  }
15 
16  public Device createDevice(int index){
17  try {
18  long deviceHandle = nCreateDevice(mHandle, index);
19  return new Device(deviceHandle);
20  }catch (Exception e){
21  Log.e(TAG, e.getMessage());
22  return null;
23  }
24  }
25 
26  public boolean containesDevice(Device device){
27  return nContainsDevice(mHandle, device.getHandle());
28  }
29 
30  public void foreach(DeviceCallback callback) {
31  int size = getDeviceCount();
32  for(int i = 0; i < size; i++) {
33  try(Device d = createDevice(i)){
34  callback.onDevice(d);
35  }
36  }
37  }
38 
39  @Override
40  public void close() {
41  nRelease(mHandle);
42  }
43 
44  private static native int nGetDeviceCount(long handle);
45  private static native long nCreateDevice(long handle, int index);
46  private static native boolean nContainsDevice(long handle, long deviceHandle);
47  private static native void nRelease(long handle);
48 }
::rosgraph_msgs::Log_< std::allocator< void > > Log
Definition: Log.h:88
static native boolean nContainsDevice(long handle, long deviceHandle)
GLuint64 GLenum void * handle
Definition: glext.h:7785
d
Definition: rmse.py:171
e
Definition: rmse.py:177
::std_msgs::String_< std::allocator< void > > String
Definition: String.h:47
GLuint index
static native long nCreateDevice(long handle, int index)
GLsizeiptr size
static native int nGetDeviceCount(long handle)
def callback(frame)
Definition: t265_stereo.py:91
static native void nRelease(long handle)
int i
auto device
Definition: pyrs_net.cpp:17


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