Skip to content

Commit 5dc5f85

Browse files
authored
Merge pull request #1346 from fuzzypixelz/fix-protocol-typos
Fix typos in `JOIN` message specification
2 parents 983908b + dfeec61 commit 5dc5f85

File tree

1 file changed

+10
-14
lines changed
  • commons/zenoh-protocol/src/transport

1 file changed

+10
-14
lines changed

commons/zenoh-protocol/src/transport/join.rs

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ use crate::{
3939
///
4040
/// ```text
4141
/// Flags:
42-
/// - T: Lease period if T==1 then the lease period is in seconds else in milliseconds
42+
/// - T: Lease period if T==1 then the lease period is in seconds otherwise it is in milliseconds
4343
/// - S: Size params If S==1 then size parameters are exchanged
44-
/// - Z: Extensions If Z==1 then zenoh extensions will follow.
44+
/// - Z: Extensions If Z==1 then Zenoh extensions will follow.
4545
///
4646
/// 7 6 5 4 3 2 1 0
4747
/// +-+-+-+-+-+-+-+-+
@@ -51,7 +51,7 @@ use crate::{
5151
/// +---------------+
5252
/// |zid_len|x|x|wai| (#)(*)
5353
/// +-------+-+-+---+
54-
/// ~ [u8] ~ -- ZenohID of the sender of the INIT message
54+
/// ~ [u8] ~ -- ZenohID of the sender of the JOIN message
5555
/// +---------------+
5656
/// |x|x|x|x|rid|fsn| \ -- SN/ID resolution (+)
5757
/// +---------------+ | if Flag(S)==1
@@ -60,13 +60,11 @@ use crate::{
6060
/// +---------------+
6161
/// % lease % -- Lease period of the sender of the JOIN message
6262
/// +---------------+
63-
/// % next_sn % -- Next SN to be sent by the sender of the JOIN(^)
63+
/// % next_sn % -- Next SN to be sent by the sender of the JOIN message (^)
6464
/// +---------------+
6565
/// ~ [JoinExts] ~ -- if Flag(Z)==1
6666
/// +---------------+
6767
///
68-
/// If A==1 and S==0 then size parameters are (ie. S flag) are accepted.
69-
///
7068
/// (*) WhatAmI. It indicates the role of the zenoh node sending the JOIN message.
7169
/// The valid WhatAmI values are:
7270
/// - 0b00: Router
@@ -93,14 +91,6 @@ use crate::{
9391
///
9492
/// (^) The next sequence number MUST be compatible with the adverstised Sequence Number resolution
9593
/// ```
96-
///
97-
98-
pub mod flag {
99-
pub const T: u8 = 1 << 5; // 0x20 Lease period if T==1 then the lease period is in seconds else in milliseconds
100-
pub const S: u8 = 1 << 6; // 0x40 Size params if S==1 then size parameters are advertised
101-
pub const Z: u8 = 1 << 7; // 0x80 Extensions if Z==1 then an extension will follow
102-
}
103-
10494
#[derive(Debug, Clone, PartialEq, Eq)]
10595
pub struct Join {
10696
pub version: u8,
@@ -114,6 +104,12 @@ pub struct Join {
114104
pub ext_shm: Option<ext::Shm>,
115105
}
116106

107+
pub mod flag {
108+
pub const T: u8 = 1 << 5; // 0x20 Lease period if T==1 then the lease period is in seconds else in milliseconds
109+
pub const S: u8 = 1 << 6; // 0x40 Size params if S==1 then size parameters are advertised
110+
pub const Z: u8 = 1 << 7; // 0x80 Extensions if Z==1 then an extension will follow
111+
}
112+
117113
// Extensions
118114
pub mod ext {
119115
use alloc::boxed::Box;

0 commit comments

Comments
 (0)