[][src]Trait dynamixel2::instructions::Instruction

pub trait Instruction {
    type Response;
    fn request_packet_id(&self) -> u8;
fn request_instruction_id(&self) -> u8;
fn request_parameters_len(&self) -> u16;
fn encode_request_parameters(&self, buffer: &mut [u8]);
fn decode_response_parameters(
        &mut self,
        packet_id: u8,
        parameters: &[u8]
    ) -> Result<Self::Response, InvalidMessage>; }

Associated Types

type Response

The response type.

Loading content...

Required methods

fn request_packet_id(&self) -> u8

The packet ID.

fn request_instruction_id(&self) -> u8

The instruction ID for the request.

fn request_parameters_len(&self) -> u16

The amount of parameter bytes before bitstuffing.

fn encode_request_parameters(&self, buffer: &mut [u8])

Encode the request parameters to the target buffer.

The buffer is guaranteed to be atleast as large as returned by Instruction::request_parameters_len.

fn decode_response_parameters(
    &mut self,
    packet_id: u8,
    parameters: &[u8]
) -> Result<Self::Response, InvalidMessage>

Decode the response from the parameters.

Loading content...

Implementors

impl Instruction for Action[src]

type Response = ()

impl Instruction for ClearMultiTurnCounter[src]

type Response = ()

impl Instruction for FactoryReset[src]

type Response = ()

impl Instruction for Ping[src]

type Response = PingResponse

impl Instruction for ReadU8[src]

type Response = u8

impl Instruction for ReadU16[src]

type Response = u16

impl Instruction for ReadU32[src]

type Response = u32

impl Instruction for Reboot[src]

type Response = ()

impl Instruction for RegWriteU8[src]

type Response = ()

impl Instruction for RegWriteU16[src]

type Response = ()

impl Instruction for RegWriteU32[src]

type Response = ()

impl Instruction for WriteU8[src]

type Response = ()

impl Instruction for WriteU16[src]

type Response = ()

impl Instruction for WriteU32[src]

type Response = ()

impl<'_> Instruction for Raw<'_>[src]

type Response = RawResponse

impl<'_> Instruction for Read<'_>[src]

type Response = ()

impl<'_> Instruction for RegWrite<'_>[src]

type Response = ()

impl<'_> Instruction for SyncRead<'_>[src]

type Response = u8

impl<'_> Instruction for SyncReadU8<'_>[src]

type Response = (u8, u8)

impl<'_> Instruction for SyncReadU16<'_>[src]

type Response = (u8, u16)

impl<'_> Instruction for SyncReadU32<'_>[src]

type Response = (u8, u32)

impl<'_> Instruction for SyncReadVec<'_>[src]

type Response = (u8, Vec<u8>)

impl<'_> Instruction for SyncWrite<'_>[src]

type Response = u8

impl<'_> Instruction for SyncWriteU8<'_>[src]

type Response = u8

impl<'_> Instruction for SyncWriteU16<'_>[src]

type Response = u8

impl<'_> Instruction for SyncWriteU32<'_>[src]

type Response = u8

impl<'_> Instruction for Write<'_>[src]

type Response = ()

Loading content...