Example #1
0
JNIEXPORT void JNICALL Java_org_librealsense_Native_rs2ConfigEnableDevice
  (JNIEnv *env, jclass, jlong configAddr, jstring jSerial) {
    rs2_error *error = NULL;
    rs2_config* config = (rs2_config*) configAddr;
    const char *serial = env->GetStringUTFChars(jSerial, 0);
    rs2_config_enable_device(config, serial, &error);
    env->ReleaseStringUTFChars(jSerial, serial);
    checkErrors(env, error);
}
Example #2
0
 /**
 * Select a specific device explicitly by its serial number, to be used by the pipeline.
 * The conditions and behavior of this method are similar to those of \c enable_stream().
 * This method is required if the application needs to set device or sensor settings prior to pipeline streaming,
 * to enforce the pipeline to use the configured device.
 *
 * \param[in] serial device serial number, as returned by RS2_CAMERA_INFO_SERIAL_NUMBER
 */
 void enable_device(const std::string& serial)
 {
     rs2_error* e = nullptr;
     rs2_config_enable_device(_config.get(), serial.c_str(), &e);
     error::handle(e);
 }