Skip to content

Commit

Permalink
Fix interest declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
sashacmc committed Jan 15, 2025
1 parent ef5b7a6 commit 15c523e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/zenoh-pico/net/session.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ typedef struct _z_session_t {
_z_pending_query_list_t *_pending_queries;
#endif

#if Z_FEATURE_INTEREST == 1
#if Z_FEATURE_MATCHING == 1
_z_matching_listener_intmap_t _matching_listeners;
#endif

Expand Down
3 changes: 2 additions & 1 deletion src/api/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,8 @@ z_result_t z_publisher_declare_matching_listener(const z_loaned_publisher_t *pub

z_result_t z_publisher_get_matching_status(const z_loaned_publisher_t *publisher,
z_matching_status_t *matching_status) {
// TODO(sashacmc): check implementation
// Ideally this should be implemented as a real request to the router, but this works much faster.
// And it works as long as filtering is enabled along with interest
matching_status->matching = publisher->_filter.ctx->state != WRITE_FILTER_ACTIVE;
return _Z_RES_OK;
}
Expand Down
4 changes: 2 additions & 2 deletions src/net/matching.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ static void _z_matching_listener_callback(const _z_interest_msg_t *msg, void *ar

_z_matching_listener_t _z_matching_listener_declare(_z_session_rc_t *zn, const _z_keyexpr_t *key, _z_zint_t entity_id,
_z_closure_matching_status_t callback) {
uint8_t flags = _Z_INTEREST_FLAG_KEYEXPRS | _Z_INTEREST_FLAG_SUBSCRIBERS | _Z_INTEREST_FLAG_RESTRICTED |
_Z_INTEREST_FLAG_CURRENT | _Z_INTEREST_FLAG_FUTURE | _Z_INTEREST_FLAG_AGGREGATE;
uint8_t flags = _Z_INTEREST_FLAG_SUBSCRIBERS | _Z_INTEREST_FLAG_RESTRICTED | _Z_INTEREST_FLAG_FUTURE |
_Z_INTEREST_FLAG_AGGREGATE;
_z_matching_listener_t ret = _z_matching_listener_null();

_z_matching_listener_ctx_t *ctx = _z_matching_listener_ctx_new(callback);
Expand Down

0 comments on commit 15c523e

Please sign in to comment.