ros2-interfaces-rolling 0.0.1

Structs for Messages and Services listed by ROS Index for ROS2 Rolling. Built around the `ros2-client` crate.
Documentation
use serde::{Deserialize, Serialize};


#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetIOReq {
    pub fun: i8,
    pub pin: i8,
    pub state: f32,
}

impl SetIOReq {
    pub const PIN_AOUT0: i8 = 0;
    pub const PIN_AOUT1: i8 = 1;
    pub const PIN_DOUT0: i8 = 0;
    pub const PIN_DOUT1: i8 = 1;
    pub const PIN_DOUT2: i8 = 2;
    pub const PIN_DOUT3: i8 = 3;
    pub const PIN_DOUT4: i8 = 4;
    pub const PIN_DOUT5: i8 = 5;
    pub const PIN_DOUT6: i8 = 6;
    pub const PIN_DOUT7: i8 = 7;
    pub const PIN_CONF_OUT0: i8 = 8;
    pub const PIN_CONF_OUT1: i8 = 9;
    pub const PIN_CONF_OUT2: i8 = 10;
    pub const PIN_CONF_OUT3: i8 = 11;
    pub const PIN_CONF_OUT4: i8 = 12;
    pub const PIN_CONF_OUT5: i8 = 13;
    pub const PIN_CONF_OUT6: i8 = 14;
    pub const PIN_CONF_OUT7: i8 = 15;
    pub const PIN_TOOL_DOUT0: i8 = 16;
    pub const PIN_TOOL_DOUT1: i8 = 17;
    pub const FUN_SET_DIGITAL_OUT: i8 = 1;
    pub const FUN_SET_FLAG: i8 = 2;
    pub const FUN_SET_ANALOG_OUT: i8 = 3;
    pub const FUN_SET_TOOL_VOLTAGE: i8 = 4;
    pub const STATE_OFF: i8 = 0;
    pub const STATE_ON: i8 = 1;
    pub const STATE_TOOL_VOLTAGE_0V: i8 = 0;
    pub const STATE_TOOL_VOLTAGE_12V: i8 = 12;
    pub const STATE_TOOL_VOLTAGE_24V: i8 = 24;
}

impl Default for SetIOReq {
    fn default() -> Self {
        SetIOReq {
            fun: 0,
            pin: 0,
            state: 0.0,
        }
    }
}

impl ros2_client::Message for SetIOReq {}



#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetIORes {
    pub success: bool,
}

impl Default for SetIORes {
    fn default() -> Self {
        SetIORes {
            success: false,
        }
    }
}

impl ros2_client::Message for SetIORes {}


pub struct SetIO;
impl ros2_client::Service for SetIO {
    type Request = SetIOReq;
    type Response = SetIORes;

    fn request_type_name(&self) -> &str { "SetIOReq" }
    fn response_type_name(&self) -> &str { "SetIORes" }
}