Skip to content

Commit

Permalink
chore: update zenoh version
Browse files Browse the repository at this point in the history
  • Loading branch information
wyfo committed Sep 12, 2024
1 parent bc68fb4 commit e83c242
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 51 deletions.
53 changes: 26 additions & 27 deletions zenoh-jni/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion zenoh-jni/src/queryable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use zenoh::query::Queryable;
pub(crate) unsafe extern "C" fn Java_io_zenoh_jni_JNIQueryable_freePtrViaJNI(
_env: JNIEnv,
_: JClass,
queryable_ptr: *const Queryable<'_, ()>,
queryable_ptr: *const Queryable<()>,
) {
Arc::from_raw(queryable_ptr);
}
47 changes: 24 additions & 23 deletions zenoh-jni/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,27 @@
// ZettaScale Zenoh Team, <[email protected]>
//

use crate::errors::Result;
use crate::key_expr::process_kotlin_key_expr;
use crate::{jni_error, utils::*};
use crate::{session_error, throw_exception};
use std::{mem, ops::Deref, ptr::null, sync::Arc, time::Duration};

use jni::objects::{GlobalRef, JByteArray, JClass, JObject, JString, JValue};
use jni::sys::{jboolean, jint, jlong};
use jni::JNIEnv;
use std::mem;
use std::ops::Deref;
use std::ptr::null;
use std::sync::Arc;
use std::time::Duration;
use zenoh::config::{Config, ZenohId};
use zenoh::key_expr::KeyExpr;
use zenoh::prelude::Wait;
use zenoh::pubsub::{Publisher, Subscriber};
use zenoh::query::{Query, Queryable, ReplyError, Selector};
use zenoh::sample::Sample;
use zenoh::session::{Session, SessionDeclarations};
use jni::{
objects::{GlobalRef, JByteArray, JClass, JObject, JString, JValue},
sys::{jboolean, jint, jlong},
JNIEnv,
};
use zenoh::{
config::{Config, ZenohId},
key_expr::KeyExpr,
prelude::Wait,
pubsub::{Publisher, Subscriber},
query::{Query, Queryable, ReplyError, Selector},
sample::Sample,
session::Session,
};

use crate::{
errors::Result, jni_error, key_expr::process_kotlin_key_expr, session_error, throw_exception,
utils::*,
};

/// Open a Zenoh session via JNI.
///
Expand Down Expand Up @@ -444,9 +445,9 @@ pub unsafe extern "C" fn Java_io_zenoh_jni_JNISession_declareSubscriberViaJNI(
session_ptr: *const Session,
callback: JObject,
on_close: JObject,
) -> *const Subscriber<'static, ()> {
) -> *const Subscriber<()> {
let session = Arc::from_raw(session_ptr);
|| -> Result<*const Subscriber<'static, ()>> {
|| -> Result<*const Subscriber<()>> {
let java_vm = Arc::new(get_java_vm(&mut env)?);
let callback_global_ref = get_callback_global_ref(&mut env, callback)?;
let on_close_global_ref = get_callback_global_ref(&mut env, on_close)?;
Expand Down Expand Up @@ -572,9 +573,9 @@ pub unsafe extern "C" fn Java_io_zenoh_jni_JNISession_declareQueryableViaJNI(
callback: JObject,
on_close: JObject,
complete: jboolean,
) -> *const Queryable<'static, ()> {
) -> *const Queryable<()> {
let session = Arc::from_raw(session_ptr);
let query_ptr = || -> Result<*const Queryable<'static, ()>> {
let query_ptr = || -> Result<*const Queryable<()>> {
let java_vm = Arc::new(get_java_vm(&mut env)?);
let callback_global_ref = get_callback_global_ref(&mut env, callback)?;
let on_close_global_ref = get_callback_global_ref(&mut env, on_close)?;
Expand Down

0 comments on commit e83c242

Please sign in to comment.