pub struct Signer { /* private fields */ }Expand description
Signs outgoing v2 frames with a shared key.
A signer holds the key, the link id it stamps, and a monotonically increasing
timestamp. Seed the timestamp from a field clock with
timestamp_from_unix_micros where one is available; without a clock, any strictly
increasing seed works, since the receiver only requires that timestamps rise.
Implementations§
Source§impl Signer
impl Signer
Sourcepub fn sign(
&mut self,
header: Header,
msgid: u32,
payload: &[u8],
crc_extra: u8,
) -> Result<Frame>
pub fn sign( &mut self, header: Header, msgid: u32, payload: &[u8], crc_extra: u8, ) -> Result<Frame>
Builds and signs a v2 frame for a message.
The frame is assembled with the signed flag set so the flag is covered by the checksum, then the signature block is filled and the signer’s timestamp advanced.
§Arguments
header- the addressing fields to stamp on the frame.msgid- the 24-bit message id.payload- the serialized message payload.crc_extra- theCRC_EXTRAseed formsgid.
§Returns
The signed frame, ready to send.
§Errors
Returns MavlinkError::PayloadTooLong if the payload does not fit a frame.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Signer
impl RefUnwindSafe for Signer
impl Send for Signer
impl Sync for Signer
impl Unpin for Signer
impl UnsafeUnpin for Signer
impl UnwindSafe for Signer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more