forked from eclipse-zenoh/zenoh-c
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit '85f6c655564fb73e1151987430cb95318f4eca26'
Conflicts: Cargo.toml.in
- Loading branch information
Showing
12 changed files
with
49 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
use crate::transmute::{TransmuteCopy, TransmuteFromHandle}; | ||
// | ||
// Copyright (c) 2017, 2022 ZettaScale Technology. | ||
// | ||
|
@@ -12,11 +11,12 @@ use crate::transmute::{TransmuteCopy, TransmuteFromHandle}; | |
// Contributors: | ||
// ZettaScale Zenoh team, <[email protected]> | ||
// | ||
use crate::transmute::{TransmuteCopy, TransmuteFromHandle}; | ||
use crate::{errors, z_closure_zid_call, z_closure_zid_loan, z_loaned_session_t, z_owned_closure_zid_t}; | ||
use std::mem::MaybeUninit; | ||
use zenoh::config::ZenohId; | ||
use zenoh::prelude::sync::SyncResolve; | ||
use zenoh::session::SessionDeclarations; | ||
use zenoh::core::Wait; | ||
|
||
pub use crate::opaque_types::z_id_t; | ||
decl_transmute_copy!(ZenohId, z_id_t); | ||
|
@@ -36,7 +36,7 @@ impl From<[u8; 16]> for z_id_t { | |
#[no_mangle] | ||
pub unsafe extern "C" fn z_info_zid(session: &z_loaned_session_t) -> z_id_t { | ||
let session = session.transmute_ref(); | ||
session.info().zid().res_sync().transmute_copy() | ||
session.info().zid().wait().transmute_copy() | ||
} | ||
|
||
/// Fetches the Zenoh IDs of all connected peers. | ||
|
@@ -54,7 +54,7 @@ pub unsafe extern "C" fn z_info_peers_zid( | |
let mut closure = z_owned_closure_zid_t::empty(); | ||
std::mem::swap(&mut closure, callback); | ||
let session = session.transmute_ref(); | ||
for id in session.info().peers_zid().res_sync() { | ||
for id in session.info().peers_zid().wait() { | ||
z_closure_zid_call(z_closure_zid_loan(&closure), &id.transmute_copy()); | ||
} | ||
errors::Z_OK | ||
|
@@ -75,7 +75,7 @@ pub unsafe extern "C" fn z_info_routers_zid( | |
let mut closure = z_owned_closure_zid_t::empty(); | ||
std::mem::swap(&mut closure, callback); | ||
let session = session.transmute_ref(); | ||
for id in session.info().routers_zid().res_sync() { | ||
for id in session.info().routers_zid().wait() { | ||
z_closure_zid_call(z_closure_zid_loan(&closure), &id.transmute_copy()); | ||
} | ||
errors::Z_OK | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ | |
// Contributors: | ||
// ZettaScale Zenoh team, <[email protected]> | ||
// | ||
|
||
use std::mem::MaybeUninit; | ||
|
||
use crate::errors; | ||
|
@@ -28,11 +27,11 @@ use crate::z_view_str_from_substring; | |
use crate::z_view_str_t; | ||
use libc::c_char; | ||
use std::error::Error; | ||
use zenoh::core::SyncResolve; | ||
use zenoh::key_expr::SetIntersectionLevel; | ||
use zenoh::prelude::keyexpr; | ||
use zenoh::prelude::KeyExpr; | ||
use zenoh_protocol::core::key_expr::canon::Canonizable; | ||
use zenoh::core::Wait; | ||
|
||
pub use crate::opaque_types::z_owned_keyexpr_t; | ||
pub use crate::opaque_types::z_view_keyexpr_t; | ||
|
@@ -447,7 +446,7 @@ pub extern "C" fn z_declare_keyexpr( | |
let this = this.transmute_uninit_ptr(); | ||
let key_expr = key_expr.transmute_ref(); | ||
let session = session.transmute_ref(); | ||
match session.declare_keyexpr(key_expr).res_sync() { | ||
match session.declare_keyexpr(key_expr).wait() { | ||
Ok(id) => { | ||
Inplace::init(this, Some(id.into_owned())); | ||
errors::Z_OK | ||
|
@@ -473,7 +472,7 @@ pub extern "C" fn z_undeclare_keyexpr( | |
return errors::Z_EINVAL; | ||
}; | ||
let session = session.transmute_ref(); | ||
match session.undeclare(kexpr).res() { | ||
match session.undeclare(kexpr).wait() { | ||
Ok(()) => errors::Z_OK, | ||
Err(e) => { | ||
log::debug!("{}", e); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.