pub struct SettingResponse {
pub response_index: u8,
pub zero_point_success: bool,
pub trajectory_index: u8,
pub pack_complete_status: Option<TrajectoryPackCompleteStatus>,
pub name_index: u16,
pub crc16: u16,
}Expand description
设置指令应答 (0x476)
用于应答设置指令的执行结果。 注意:此帧有两种用途:
- 设置指令应答(Byte 0 = 设置指令 ID 的最后一个字节,如 0x471 -> 0x71)
- 轨迹传输应答(Byte 0 = 0x50,Byte 2 = 轨迹点索引,Byte 3 = 轨迹包传输完成应答)
Fields§
§response_index: u8§zero_point_success: bool§trajectory_index: u8§pack_complete_status: Option<TrajectoryPackCompleteStatus>§name_index: u16§crc16: u16Implementations§
Source§impl SettingResponse
impl SettingResponse
Sourcepub fn is_trajectory_response(&self) -> bool
pub fn is_trajectory_response(&self) -> bool
判断是否为轨迹传输应答
Sourcepub fn is_setting_response(&self) -> bool
pub fn is_setting_response(&self) -> bool
判断是否为设置指令应答
Sourcepub fn trajectory_pack_complete_status(
&self,
) -> Option<TrajectoryPackCompleteStatus>
pub fn trajectory_pack_complete_status( &self, ) -> Option<TrajectoryPackCompleteStatus>
获取轨迹包传输完成状态(如果是轨迹传输应答)
Sourcepub fn trajectory_point_index(&self) -> Option<u8>
pub fn trajectory_point_index(&self) -> Option<u8>
获取轨迹点索引(如果是轨迹传输应答)
Sourcepub fn trajectory_name_index(&self) -> Option<u16>
pub fn trajectory_name_index(&self) -> Option<u16>
获取轨迹包名称索引(如果是轨迹传输应答)
Sourcepub fn trajectory_crc16(&self) -> Option<u16>
pub fn trajectory_crc16(&self) -> Option<u16>
获取轨迹包 CRC16(如果是轨迹传输应答)
Trait Implementations§
Source§impl Clone for SettingResponse
impl Clone for SettingResponse
Source§fn clone(&self) -> SettingResponse
fn clone(&self) -> SettingResponse
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SettingResponse
impl Debug for SettingResponse
Source§impl TryFrom<PiperFrame> for SettingResponse
impl TryFrom<PiperFrame> for SettingResponse
Source§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
Source§fn try_from(
frame: PiperFrame,
) -> Result<SettingResponse, <SettingResponse as TryFrom<PiperFrame>>::Error>
fn try_from( frame: PiperFrame, ) -> Result<SettingResponse, <SettingResponse as TryFrom<PiperFrame>>::Error>
Performs the conversion.
impl Copy for SettingResponse
Auto Trait Implementations§
impl Freeze for SettingResponse
impl RefUnwindSafe for SettingResponse
impl Send for SettingResponse
impl Sync for SettingResponse
impl Unpin for SettingResponse
impl UnwindSafe for SettingResponse
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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