Skip to main content

FirmwareReadFeedback

Struct FirmwareReadFeedback 

Source
pub struct FirmwareReadFeedback {
    pub firmware_data: [u8; 8],
}
Expand description

固件版本读取反馈 (0x4AF)

用于接收机械臂固件版本信息。 注意:固件版本数据可能是分多个 CAN 帧传输的,需要累积接收。

Fields§

§firmware_data: [u8; 8]

Implementations§

Source§

impl FirmwareReadFeedback

Source

pub fn firmware_data(&self) -> &[u8; 8]

获取固件数据原始字节

Source

pub fn parse_version_string(accumulated_data: &[u8]) -> Option<String>

尝试从累积的固件数据中解析版本字符串

固件版本字符串通常以 “S-V” 开头,后面跟版本号。 此方法会在累积数据中查找版本字符串。

注意:与 Python SDK 对齐,固定提取 8 字节长度(从 S-V 开始,包括 S-V)。

§参数
  • accumulated_data: 累积的固件数据(可能包含多个 CAN 帧的数据)
§返回值

如果找到版本字符串,返回 Some(String),否则返回 None

Trait Implementations§

Source§

impl Clone for FirmwareReadFeedback

Source§

fn clone(&self) -> FirmwareReadFeedback

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FirmwareReadFeedback

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for FirmwareReadFeedback

Source§

fn default() -> FirmwareReadFeedback

Returns the “default value” for a type. Read more
Source§

impl TryFrom<PiperFrame> for FirmwareReadFeedback

Source§

type Error = ProtocolError

The type returned in the event of a conversion error.
Source§

fn try_from( frame: PiperFrame, ) -> Result<FirmwareReadFeedback, <FirmwareReadFeedback as TryFrom<PiperFrame>>::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more