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
use super::*;
use service_3::service_3_5x6::*;
use tc::TcPacket;
const MES_SUBTYPE: u8 = 5;
impl SpacePacket<TcPacket<Service3_5x6>> {
pub fn new_service_3_5(
apid: u16,
packet_name: u16,
n: u8,
report_ids: Vec<u8>,
) -> Result<Self, Error> {
SpacePacket::<TcPacket<Service3_5x6>>::new_service_3_5x6(
MES_SUBTYPE,
apid,
packet_name,
n,
report_ids,
)
}
pub fn from_bytes_service_3_5(buffer: &[u8]) -> Result<Self, Error> {
let res = SpacePacket::from_bytes_service_3_5x6(&buffer)?;
if res.data.header.message_subtype != MES_SUBTYPE {
return Err(Error::CorruptData);
}
Ok(res)
}
}