pub fn ubx_struct_from_bytes<T>(input: &[u8]) -> Option<T> {
    unsafe {
        // due to struct layout / padding issues, the size of the struct
        // might be, say, 4-byte word aligned while the message length is smaller
        let mut msg = core::mem::zeroed();
        let msg_as_slice = core::slice::from_raw_parts_mut(
            &mut msg as *mut T as *mut u8,
            input.len(),
        );
        msg_as_slice.copy_from_slice(input);
        Some(msg)
    }
}
/// Read a UBX message type from bytes
Read a UBX message type from bytes
Read a UBX message type from bytes
pub fn ubx_struct_from_bytes<T>(input: &[u8]) -> Option<T> {
    unsafe {
        // due to struct layout / padding issues, the size of the struct
        // might be, say, 4-byte word aligned while the message length is smaller
        let mut msg = core::mem::zeroed();
        let msg_as_slice = core::slice::from_raw_parts_mut(
            &mut msg as *mut T as *mut u8,
            input.len(),
        );
        msg_as_slice.copy_from_slice(input);
        Some(msg)
    }
}
pub fn ubx_struct_from_bytes < T > ( input : & [ u8 ] ) -> Option < T > { unsafe { // due to struct layout / padding issues, the size of the struct // might be, say, 4-byte word aligned while the message length is smaller let mut msg = core :: mem :: zeroed ( ) ; let msg_as_slice = core :: slice :: from_raw_parts_mut ( & mut msg as * mut T as * mut u8 , input . len ( ) , ) ; msg_as_slice . copy_from_slice ( input ) ; Some ( msg ) } }
Read a UBX message type from bytes
Read a UBX message type from bytes
input
&[u8]
input
&[u8]