[][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 Ping[src]

type Response = PingResponse

impl Instruction for ReadU16[src]

type Response = u16

impl Instruction for ReadU32[src]

type Response = u32

impl Instruction for ReadU8[src]

type Response = u8

impl Instruction for Reboot[src]

type Response = ()

impl Instruction for WriteU16[src]

type Response = ()

impl Instruction for WriteU32[src]

type Response = ()

impl Instruction for WriteU8[src]

type Response = ()

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

type Response = ()

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

type Response = ()

Loading content...