Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update to zenoh-c 1.0.0.8 changes #20

Merged
merged 2 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions rmw_zenoh_cpp/src/detail/rmw_data_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ bool rmw_client_data_t::is_shutdown() const

//==============================================================================
void sub_data_handler(
const z_loaned_sample_t * sample,
z_loaned_sample_t * sample,
void * data)
{
z_view_string_t keystr;
Expand Down Expand Up @@ -509,7 +509,7 @@ const z_loaned_query_t * ZenohQuery::get_query() const
}

//==============================================================================
void service_data_handler(const z_loaned_query_t * query, void * data)
void service_data_handler(z_loaned_query_t * query, void * data)
{
z_view_string_t keystr;
z_keyexpr_as_view_string(z_query_keyexpr(query), &keystr);
Expand Down Expand Up @@ -554,7 +554,7 @@ size_t rmw_client_data_t::get_next_sequence_number()
}

//==============================================================================
void client_data_handler(const z_loaned_reply_t * reply, void * data)
void client_data_handler(z_loaned_reply_t * reply, void * data)
{
auto client_data = static_cast<rmw_client_data_t *>(data);
if (client_data == nullptr) {
Expand Down
6 changes: 3 additions & 3 deletions rmw_zenoh_cpp/src/detail/rmw_data_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class rmw_publisher_data_t final

///=============================================================================
// z_owned_closure_sample_t
void sub_data_handler(const z_loaned_sample_t * sample, void * sub_data);
void sub_data_handler(z_loaned_sample_t * sample, void * sub_data);

struct saved_msg_data
{
Expand Down Expand Up @@ -198,10 +198,10 @@ class rmw_subscription_data_t final


///=============================================================================
void service_data_handler(const z_loaned_query_t * query, void * service_data);
void service_data_handler(z_loaned_query_t * query, void * service_data);

///=============================================================================
void client_data_handler(const z_loaned_reply_t * reply, void * client_data);
void client_data_handler(z_loaned_reply_t * reply, void * client_data);
void client_data_drop(void * data);

///=============================================================================
Expand Down
8 changes: 4 additions & 4 deletions rmw_zenoh_cpp/src/rmw_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ extern "C"
namespace
{
void
graph_sub_data_handler(const z_loaned_sample_t * sample, void * data)
graph_sub_data_handler(z_loaned_sample_t * sample, void * data)
{
static_cast<void>(data);

Expand Down Expand Up @@ -196,14 +196,14 @@ rmw_init(const rmw_init_options_t * options, rmw_context_t * context)
});

// Initialize the zenoh session.
if (z_open(&context->impl->session, z_move(config)) != Z_OK) {
if (z_open(&context->impl->session, z_move(config), NULL) != Z_OK) {
RMW_SET_ERROR_MSG("Error setting up zenoh session");
return RMW_RET_ERROR;
}

auto close_session = rcpputils::make_scope_exit(
[context]() {
z_close(z_move(context->impl->session));
z_close(z_move(context->impl->session), NULL);
});

/// Initialize the graph cache.
Expand Down Expand Up @@ -411,7 +411,7 @@ rmw_shutdown(rmw_context_t * context)
z_drop(z_move(context->impl->shm_provider.value()));
}
// Close the zenoh session
if (z_close(z_move(context->impl->session)) != Z_OK) {
if (z_close(z_move(context->impl->session), NULL) != Z_OK) {
RMW_SET_ERROR_MSG("Error while closing zenoh session");
return RMW_RET_ERROR;
}
Expand Down
4 changes: 3 additions & 1 deletion rmw_zenoh_cpp/src/rmw_zenoh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1426,7 +1426,9 @@ rmw_create_subscription(
// by various publishers.
sub_options.query_consolidation = z_query_consolidation_none();
if (sub_data->adapted_qos_profile.reliability == RMW_QOS_POLICY_RELIABILITY_RELIABLE) {
sub_options.reliability = Z_RELIABILITY_RELIABLE;
RMW_ZENOH_LOG_WARN_NAMED(
"rmw_zenoh_cpp",
"`reliability` no longer supported on subscriber. Ignoring...");
}

ze_owned_querying_subscriber_t sub;
Expand Down
4 changes: 2 additions & 2 deletions rmw_zenoh_cpp/src/zenohd/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ int main(int argc, char ** argv)
}

z_owned_session_t session;
if (z_open(&session, z_move(config)) != Z_OK) {
if (z_open(&session, z_move(config), NULL) != Z_OK) {
printf("Unable to open router session!\n");
return 1;
}
auto always_close_session = rcpputils::make_scope_exit(
[&session]() {
z_close(z_move(session));
z_close(z_move(session), NULL);
});

printf(
Expand Down
2 changes: 1 addition & 1 deletion zenoh_c_vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ set(ZENOHC_CARGO_FLAGS "--no-default-features$<SEMICOLON>--features=shared-memor
# - https://github.com/eclipse-zenoh/zenoh-c/pull/620 (fix ze_querying_subscriber_get API to query newly discovered publishers)
ament_vendor(zenoh_c_vendor
VCS_URL https://github.com/eclipse-zenoh/zenoh-c.git
VCS_VERSION ecad7f358fabdf55c4d6c35118415b5c457c8f20
VCS_VERSION 1.0.0.8
CMAKE_ARGS
"-DZENOHC_CARGO_FLAGS=${ZENOHC_CARGO_FLAGS}"
"-DZENOHC_BUILD_WITH_UNSTABLE_API=TRUE"
Expand Down