1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
use crate::structure::guid::EntityId;
use crate::structure::sequence_number::*;
use speedy::{Readable, Writable};
#[derive(Debug, PartialEq, Readable, Writable)]
pub struct NackFrag {
pub reader_id: EntityId,
pub writer_id: EntityId,
pub writer_sn: SequenceNumber,
pub fragment_number_state: FragmentNumberSet,
pub count: i32,
}
#[cfg(test)]
mod tests {
use super::*;
use crate::messages::fragment_number::FragmentNumber;
serialization_test!( type = NackFrag,
{
nack_frag,
NackFrag {
reader_id: EntityId::ENTITYID_SEDP_BUILTIN_PUBLICATIONS_READER,
writer_id: EntityId::ENTITYID_SEDP_BUILTIN_PUBLICATIONS_WRITER,
writer_sn: SequenceNumber::from(42),
fragment_number_state: FragmentNumberSet::new_empty(FragmentNumber::from(1000u32)),
count: 6,
},
le = [0x00, 0x00, 0x03, 0xC7,
0x00, 0x00, 0x03, 0xC2,
0x00, 0x00, 0x00, 0x00,
0x2A, 0x00, 0x00, 0x00,
0xE8, 0x03, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00],
be = [0x00, 0x00, 0x03, 0xC7,
0x00, 0x00, 0x03, 0xC2,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x2A,
0x00, 0x00, 0x03, 0xE8,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x06]
});
}