Add macros to derive message serializations.
This commit is contained in:
parent
ccd13fecf1
commit
8f35d38e93
11 changed files with 284 additions and 108 deletions
|
|
@ -4,6 +4,11 @@ use mammoth::syscall::z_cap_t;
|
|||
use mammoth::syscall::ZError;
|
||||
|
||||
pub const MESSAGE_IDENT: u32 = 0x33441122;
|
||||
pub const MESSAGE_HEADER_SIZE: usize = 24; // 4x uint32, 1x uint64
|
||||
|
||||
pub fn field_offset(offset: usize, field_index: usize) -> usize {
|
||||
offset + MESSAGE_HEADER_SIZE + (8 * field_index)
|
||||
}
|
||||
|
||||
pub trait YunqMessage {
|
||||
fn parse<const N: usize>(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue