Trait bluerobotics_ping::device::PingDevice

source ·
pub trait PingDevice {
    // Required methods
    fn get_common(&self) -> &Common;
    fn get_mut_common(&mut self) -> &mut Common;

    // Provided methods
    fn subscribe(&self) -> Receiver<ProtocolMessage> { ... }
    async fn send_general_request(
        &self,
        requested_id: u16
    ) -> Result<(), PingError> { ... }
    async fn wait_for_message<T>(
        &self,
        receiver: Receiver<ProtocolMessage>
    ) -> Result<T, PingError>
       where T: MessageInfo + Sync + Clone + Send + 'static { ... }
    async fn wait_for_ack(
        &self,
        receiver: Receiver<ProtocolMessage>,
        message_id: u16
    ) -> Result<(), PingError> { ... }
    async fn request<T>(&self) -> Result<T, PingError>
       where T: MessageInfo + Sync + Clone + Send + 'static { ... }
    async fn device_information(
        &self
    ) -> Result<DeviceInformationStruct, PingError> { ... }
    async fn protocol_version(&self) -> Result<ProtocolVersionStruct, PingError> { ... }
    async fn set_device_id(&self, device_id: u8) -> Result<(), PingError> { ... }
}

Required Methods§

source

fn get_common(&self) -> &Common

source

fn get_mut_common(&mut self) -> &mut Common

Provided Methods§

source

fn subscribe(&self) -> Receiver<ProtocolMessage>

source

async fn send_general_request(&self, requested_id: u16) -> Result<(), PingError>

source

async fn wait_for_message<T>( &self, receiver: Receiver<ProtocolMessage> ) -> Result<T, PingError>
where T: MessageInfo + Sync + Clone + Send + 'static,

source

async fn wait_for_ack( &self, receiver: Receiver<ProtocolMessage>, message_id: u16 ) -> Result<(), PingError>

source

async fn request<T>(&self) -> Result<T, PingError>
where T: MessageInfo + Sync + Clone + Send + 'static,

source

async fn device_information(&self) -> Result<DeviceInformationStruct, PingError>

Device information

source

async fn protocol_version(&self) -> Result<ProtocolVersionStruct, PingError>

The protocol version

source

async fn set_device_id(&self, device_id: u8) -> Result<(), PingError>

Set the device ID.

§Arguments
  • device_id - Device ID (1-254). 0 is unknown and 255 is reserved for broadcast messages.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl PingDevice for bluerobotics_ping::bluebps::Device

source§

impl PingDevice for bluerobotics_ping::common::Device

source§

impl PingDevice for bluerobotics_ping::omniscan450::Device

source§

impl PingDevice for bluerobotics_ping::ping1d::Device

source§

impl PingDevice for bluerobotics_ping::ping360::Device