Skip to content

Commit

Permalink
Add corrections on 1.1 (#791)
Browse files Browse the repository at this point in the history
* Update closure handlers documentaion (#736)

* Rename closure callback/dropper types (#739)

* Remove legacy z_zint_t from public API (#741)

* Add `export "C"` for all header files (#740)

* Add `export "C"` for proper closures callbacks export

* Add `export "C"` for all headers

* add serialize from substr functions (#742)

* Rename z_loaned_hello_handler_t to z_closure_hello_callback_t (#743)

* Mark z_reply_replier_id as unstable (#745)

* Add documentation about logging (#744)

* Update README.md (#746)

* hardcode clang-format runner to Ubuntu24.04 (#748)

* fix build granularity (#747)

* fix: badly named constant (#750)

* fix packages

* fix: update debian packaging

- include libzenohpico.so in debian package
- change the package name to libzenohpico in line with libzenohc
- set correct debian version for pre releases
- fix wrong version used in Release mode

* fix: debian dev package name

* fix: package version for releases (#753)

* fix: debian_version for official releases

otherwise they would be undefined

* fix: align cpack version with zenoh-c

* chore: review comments

move cpack version closer to where it's used

* build shared lib for packages instead of static one (#757)

* Fix z_task cleanup for platforms with pthread support (#759)

* Fix read/lease task cleanup (#760)

* Align ID string representation with zenoh (lowercase) (#761)

* Remove default parameters from z_closure (#755)

* build both libraries:shared and static when packaging; (#766)

add static library to dev package;

* Publish debian packages (#769)

* fix: add workflow to release debian packages

* fix: align with zenoh-c

- update package names
- set version string in the same way
- set DEBARCH/RPMARCH
- set CPACK_PACKAGE_FILE_NAME
- add -j to zip archive to not include parent folder

* fix: use CPACK_PACKAGE_NAME

* fix: pass package name to all build targets

* fix: Don't tag release branch during dry-run

* Replace exit with return in zephyr examples (#774)

* Add platform_common.c to zephyr CMakeLists.txt file

* Rework Zenoh ID conversion

* chore: Update org secrets (#782)

As per eclipse-zenoh/.eclipsefdn#18, secrets were updated to follow eclipse foundation naming convention.

* Implement liveliness support (#632)

* Mark liveliness API as unstable and disable by default

* Fix typo (#787)

* fix: correct 1.1 issues

* feat: add zp_batch_flush

* fix: switch to #if 0 to deactivate tcp function

---------

Co-authored-by: Alexander Bushnev <[email protected]>
Co-authored-by: DenisBiryukov91 <[email protected]>
Co-authored-by: Denis Biryukov <[email protected]>
Co-authored-by: Diogo Mendes Matsubara <[email protected]>
Co-authored-by: Luca Cominardi <[email protected]>
  • Loading branch information
6 people authored Nov 19, 2024
1 parent d427b0a commit eb1e7cf
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 18 deletions.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ set(Z_FEATURE_PUBLICATION 1 CACHE STRING "Toggle publication feature")
set(Z_FEATURE_SUBSCRIPTION 1 CACHE STRING "Toggle subscription feature")
set(Z_FEATURE_QUERY 1 CACHE STRING "Toggle query feature")
set(Z_FEATURE_QUERYABLE 1 CACHE STRING "Toggle queryable feature")
set(Z_FEATURE_LIVELINESS 1 CACHE STRING "Toggle liveliness feature")
set(Z_FEATURE_LIVELINESS 0 CACHE STRING "Toggle liveliness feature")
set(Z_FEATURE_INTEREST 1 CACHE STRING "Toggle interests")
set(Z_FEATURE_FRAGMENTATION 1 CACHE STRING "Toggle fragmentation")
set(Z_FEATURE_ENCODING_VALUES 1 CACHE STRING "Toggle encoding values")
Expand All @@ -239,6 +239,12 @@ set(Z_FEATURE_PUBLISHER_SESSION_CHECK 1 CACHE STRING "Toggle publisher session c
set(Z_FEATURE_BATCHING 1 CACHE STRING "Toggle batching")
set(Z_FEATURE_RX_CACHE 0 CACHE STRING "Toggle RX_CACHE")

# Add a warning message if someone tries to enable Z_FEATURE_LIVELINESS directly
if(Z_FEATURE_LIVELINESS AND NOT Z_FEATURE_UNSTABLE_API)
message(WARNING "Z_FEATURE_LIVELINESS can only be enabled when Z_FEATURE_UNSTABLE_API is also enabled. Disabling Z_FEATURE_LIVELINESS.")
set(Z_FEATURE_LIVELINESS 0 CACHE STRING "Toggle liveliness feature" FORCE)
endif()

add_compile_definitions("Z_BUILD_DEBUG=$<CONFIG:Debug>")
message(STATUS "Building with feature confing:\n\
* UNSTABLE_API: ${Z_FEATURE_UNSTABLE_API}\n\
Expand Down
2 changes: 1 addition & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,7 @@ See details at :ref:`owned_types_concept`
Functions
---------
.. autocfunction:: liveliness.h::z_liveliness_token_options_t_default
.. autocfunction:: liveliness.h::z_liveliness_token_options_default
.. autocfunction:: liveliness.h::z_liveliness_declare_token
.. autocfunction:: liveliness.h::z_liveliness_undeclare_token
.. autocfunction:: liveliness.h::z_liveliness_subscriber_options_default
Expand Down
2 changes: 1 addition & 1 deletion include/zenoh-pico/api/liveliness.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ typedef struct z_liveliness_token_options_t {
/**
* Constructs default value for :c:type:`z_liveliness_token_options_t`.
*/
z_result_t z_liveliness_token_options_t_default(z_liveliness_token_options_t *options);
z_result_t z_liveliness_token_options_default(z_liveliness_token_options_t *options);

/**
* Constructs and declares a liveliness token on the network.
Expand Down
19 changes: 15 additions & 4 deletions include/zenoh-pico/api/primitives.h
Original file line number Diff line number Diff line change
Expand Up @@ -2063,9 +2063,9 @@ const z_loaned_keyexpr_t *z_subscriber_keyexpr(const z_loaned_subscriber_t *subs
#ifdef Z_FEATURE_UNSTABLE_API
#if Z_FEATURE_BATCHING == 1
/**
* Activate the batching mechanism.
* Any message that would have been sent on the network by a subsequent api call (e.g z_put, z_get)
* will be instead stored until the batch is full or batching is stopped with :c:func:`zp_batch_stop`.
* Activate the batching mechanism, any message that would have been sent on the network by a subsequent api call (e.g
* z_put, z_get) will be instead stored until the batch is full, flushed with :c:func:`zp_batch_flush` or batching is
* stopped with :c:func:`zp_batch_stop`.
*
* Parameters:
* zs: Pointer to a :c:type:`z_loaned_session_t` that will start batching messages.
Expand All @@ -2076,7 +2076,18 @@ const z_loaned_keyexpr_t *z_subscriber_keyexpr(const z_loaned_subscriber_t *subs
z_result_t zp_batch_start(const z_loaned_session_t *zs);

/**
* Deactivate the batching mechanism and flush the remaining messages.
* Send the currently batched messages on the network.
*
* Parameters:
* zs: Pointer to a :c:type:`z_loaned_session_t` that will send its batched messages.
*
* Return:
* ``0`` if batch successfully sent, ``negative value`` otherwise.
*/
z_result_t zp_batch_flush(const z_loaned_session_t *zs);

/**
* Deactivate the batching mechanism and send the currently batched on the network.
*
* Parameters:
* zs: Pointer to a :c:type:`z_loaned_session_t` that will stop batching messages.
Expand Down
6 changes: 3 additions & 3 deletions include/zenoh-pico/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#define Z_FEATURE_SUBSCRIPTION 1
#define Z_FEATURE_QUERY 1
#define Z_FEATURE_QUERYABLE 1
#define Z_FEATURE_LIVELINESS 1
#define Z_FEATURE_LIVELINESS 0
#define Z_FEATURE_RAWETH_TRANSPORT 0
#define Z_FEATURE_INTEREST 1
#define Z_FEATURE_DYNAMIC_MEMORY_ALLOCATION 0
Expand All @@ -44,9 +44,9 @@
#define Z_FEATURE_ENCODING_VALUES 1
#define Z_FEATURE_TCP_NODELAY 1
#define Z_FEATURE_LOCAL_SUBSCRIBER 0
#define Z_FEATURE_PUBLISHER_SESSION_CHECK 0
#define Z_FEATURE_PUBLISHER_SESSION_CHECK 1
#define Z_FEATURE_BATCHING 1
#define Z_FEATURE_RX_CACHE 1
#define Z_FEATURE_RX_CACHE 0
// End of CMake generation

/*------------------ Runtime configuration properties ------------------*/
Expand Down
4 changes: 0 additions & 4 deletions include/zenoh-pico/net/primitives.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@
extern "C" {
#endif

#ifdef __cplusplus
extern "C" {
#endif

/*------------------ Discovery ------------------*/

/**
Expand Down
9 changes: 9 additions & 0 deletions src/api/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1432,6 +1432,15 @@ z_result_t zp_batch_start(const z_loaned_session_t *zs) {
return _z_transport_start_batching(&session->_tp) ? _Z_RES_OK : _Z_ERR_GENERIC;
}

z_result_t zp_batch_flush(const z_loaned_session_t *zs) {
_z_session_t *session = _Z_RC_IN_VAL(zs);
if (_Z_RC_IS_NULL(zs)) {
return _Z_ERR_SESSION_CLOSED;
}
// Send current batch
return _z_send_n_batch(session, Z_CONGESTION_CONTROL_DEFAULT);
}

z_result_t zp_batch_stop(const z_loaned_session_t *zs) {
_z_session_t *session = _Z_RC_IN_VAL(zs);
if (_Z_RC_IS_NULL(zs)) {
Expand Down
2 changes: 0 additions & 2 deletions src/transport/multicast/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,6 @@ z_result_t _z_multicast_handle_transport_message(_z_transport_multicast_t *ztm,
_Z_INFO("Failed to decode defragmented message");
ret = _Z_ERR_MESSAGE_DESERIALIZATION_FAILED;
}
// Fragmented messages must be cleared. Non-fragmented messages are released with their transport.
_z_msg_clear(&zm);
// Free the decoding buffer
_z_zbuf_clear(&zbf);
*dbuf_state = _Z_DBUF_STATE_NULL;
Expand Down
2 changes: 0 additions & 2 deletions src/transport/unicast/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,6 @@ z_result_t _z_unicast_handle_transport_message(_z_transport_unicast_t *ztu, _z_t
_Z_INFO("Failed to decode defragmented message");
ret = _Z_ERR_MESSAGE_DESERIALIZATION_FAILED;
}
// Fragmented messages must be cleared. Non-fragmented messages are released with their transport.
_z_msg_clear(&zm);
// Free the decoding buffer
_z_zbuf_clear(&zbf);
*dbuf_state = _Z_DBUF_STATE_NULL;
Expand Down
12 changes: 12 additions & 0 deletions src/transport/unicast/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ static z_result_t _z_unicast_handshake_client(_z_transport_unicast_establish_par
return _Z_RES_OK;
}

// TODO: Activate if we add peer unicast support
#if 0
static z_result_t _z_unicast_handshake_listener(_z_transport_unicast_establish_param_t *param, const _z_link_t *zl,
const _z_id_t *local_zid, enum z_whatami_t whatami) {
// Read t message from link
Expand Down Expand Up @@ -293,6 +295,16 @@ static z_result_t _z_unicast_handshake_listener(_z_transport_unicast_establish_p
// Handshake finished
return _Z_RES_OK;
}
#else
static z_result_t _z_unicast_handshake_listener(_z_transport_unicast_establish_param_t *param, const _z_link_t *zl,
const _z_id_t *local_zid, enum z_whatami_t whatami) {
_ZP_UNUSED(param);
_ZP_UNUSED(zl);
_ZP_UNUSED(local_zid);
_ZP_UNUSED(whatami);
return _Z_ERR_TRANSPORT_OPEN_FAILED;
}
#endif

z_result_t _z_unicast_open_client(_z_transport_unicast_establish_param_t *param, const _z_link_t *zl,
const _z_id_t *local_zid) {
Expand Down

0 comments on commit eb1e7cf

Please sign in to comment.