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

Update encoding format on the wire #399

Merged
merged 8 commits into from
Apr 11, 2024

Conversation

jean-roland
Copy link
Contributor

@jean-roland jean-roland commented Apr 9, 2024

The way encoding_t prefix is sent on the wire changed to be 31bits + suffix flag. Suffix is only written when present.

Because of misalignment on interest format with Zenoh, interests are deactivated by default for now.

In addition, MSVC warning C4127: conditional statement is constant, has been disabled as it caused Windows build to fail following the addition of pull subscriber handlers.

@jean-roland
Copy link
Contributor Author

@Mallets could you review this PR?

}

int8_t _z_encoding_encode(_z_wbuf_t *wbf, const _z_encoding_t *en) {
_Bool has_suffix = _z_bytes_check(en->suffix);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For naming alignment, it should be called has_schema and en->schema.

val.encoding.prefix = gen_zint();
_z_encoding_t gen_encoding(void) {
_z_encoding_t en;
en.prefix = gen_uint32() & 0x7fffffff;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefix should be represented as an uint16_t.

@Mallets
Copy link
Member

Mallets commented Apr 11, 2024

Definition of _z_encoding_t is still:

typedef struct {
    _z_bytes_t suffix;
    z_encoding_prefix_t prefix;
} _z_encoding_t;

It should become:

typedef struct {
    _z_bytes_t schema;
    uint16_t id;
} _z_encoding_t;

z_encoding_prefix_t is meant to be deprecated and replaced with a set of constants.

@Mallets Mallets merged commit aa883f4 into eclipse-zenoh:protocol_changes Apr 11, 2024
50 checks passed
@jean-roland jean-roland deleted the ft_encoding branch May 15, 2024 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants