Skip to content

Commit

Permalink
feat: store whatami mode in session
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-roland committed Jan 13, 2025
1 parent 3eed5a5 commit 55454b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions include/zenoh-pico/net/session.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ typedef struct _z_session_t {
#endif // Z_FEATURE_MULTI_THREAD == 1

// Zenoh-pico is considering a single transport per session.
z_whatami_t _mode;
_z_transport_t _tp;

// Zenoh PID
Expand Down
4 changes: 1 addition & 3 deletions src/net/session.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ static z_result_t _z_open_inner(_z_session_rc_t *zn, _z_string_t *locator, const

_z_transport_get_common(&zt)->_session = zn;
_Z_RC_IN_VAL(zn)->_tp = zt;
_Z_RC_IN_VAL(zn)->_mode = mode;
return ret;
}

Expand All @@ -153,9 +154,6 @@ z_result_t _z_open(_z_session_rc_t *zn, _z_config_t *config, const _z_id_t *zid)
ret = _Z_RES_OK;

_z_string_t *locator = _z_string_svec_get(&locators, i);
// @TODO: check invalid configurations
// For example, client mode in multicast links

ret = _z_open_inner(zn, locator, zid, mode, peer_op);
if (ret == _Z_RES_OK) {
break;
Expand Down

0 comments on commit 55454b4

Please sign in to comment.