drtio-mgmt: reorder last param

This commit is contained in:
occheung 2024-08-23 11:46:16 +08:00
parent 1683572838
commit 1fc3ea40f7
1 changed files with 10 additions and 10 deletions

View File

@ -313,8 +313,8 @@ pub enum Packet {
},
CoreMgmtConfigWriteRequest {
destination: u8,
length: u16,
last: bool,
length: u16,
data: [u8; MASTER_PAYLOAD_MAX_SIZE],
},
CoreMgmtConfigRemoveRequest {
@ -337,8 +337,8 @@ pub enum Packet {
data: [u8; SAT_PAYLOAD_MAX_SIZE],
},
CoreMgmtConfigReadReply {
length: u16,
last: bool,
length: u16,
value: [u8; SAT_PAYLOAD_MAX_SIZE],
},
CoreMgmtAck,
@ -650,14 +650,14 @@ impl Packet {
},
0xd6 => {
let destination = reader.read_u8()?;
let length = reader.read_u16()?;
let last = reader.read_bool()?;
let length = reader.read_u16()?;
let mut data: [u8; MASTER_PAYLOAD_MAX_SIZE] = [0; MASTER_PAYLOAD_MAX_SIZE];
reader.read_exact(&mut data[0..length as usize])?;
Packet::CoreMgmtConfigWriteRequest {
destination: destination,
length: length,
last: last,
length: length,
data: data,
}
}
@ -693,13 +693,13 @@ impl Packet {
}
},
0xdc => {
let length = reader.read_u16()?;
let last = reader.read_bool()?;
let length = reader.read_u16()?;
let mut value: [u8; SAT_PAYLOAD_MAX_SIZE] = [0; SAT_PAYLOAD_MAX_SIZE];
reader.read_exact(&mut value[0..length as usize])?;
Packet::CoreMgmtConfigReadReply {
length: length,
last: last,
length: length,
value: value,
}
},
@ -1117,14 +1117,14 @@ impl Packet {
}
Packet::CoreMgmtConfigWriteRequest {
destination,
length,
last,
length,
data,
} => {
writer.write_u8(0xd6)?;
writer.write_u8(destination)?;
writer.write_u16(length)?;
writer.write_bool(last)?;
writer.write_u16(length)?;
writer.write_all(&data[0..length as usize])?;
}
Packet::CoreMgmtConfigRemoveRequest {
@ -1156,13 +1156,13 @@ impl Packet {
writer.write_all(&data[0..length as usize])?;
}
Packet::CoreMgmtConfigReadReply {
length,
last,
length,
value,
} => {
writer.write_u8(0xdc)?;
writer.write_u16(length)?;
writer.write_bool(last)?;
writer.write_u16(length)?;
writer.write_all(&value[0..length as usize])?;
}
Packet::CoreMgmtAck => writer.write_u8(0xdd)?,