Struct bluerobotics_ping::common::Device
source · pub struct Device {
pub common: Common,
}Fields§
§common: CommonImplementations§
source§impl Device
impl Device
pub fn new<T>(io: T) -> Self
sourcepub async fn protocol_version(&self) -> Result<ProtocolVersionStruct, PingError>
pub async fn protocol_version(&self) -> Result<ProtocolVersionStruct, PingError>
The protocol version
sourcepub async fn set_device_id(&self, device_id: u8) -> Result<(), PingError>
pub 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.
sourcepub async fn device_information(
&self
) -> Result<DeviceInformationStruct, PingError>
pub async fn device_information( &self ) -> Result<DeviceInformationStruct, PingError>
Device information
Trait Implementations§
source§impl PingDevice for Device
impl PingDevice for Device
fn get_common(&self) -> &Common
fn get_mut_common(&mut self) -> &mut Common
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>
async fn wait_for_ack( &self, receiver: Receiver<ProtocolMessage>, message_id: u16 ) -> Result<(), PingError>
async fn request<T>(&self) -> Result<T, PingError>
source§async fn device_information(&self) -> Result<DeviceInformationStruct, PingError>
async fn device_information(&self) -> Result<DeviceInformationStruct, PingError>
Device information
source§async fn protocol_version(&self) -> Result<ProtocolVersionStruct, PingError>
async fn protocol_version(&self) -> Result<ProtocolVersionStruct, PingError>
The protocol version
Auto Trait Implementations§
impl Freeze for Device
impl !RefUnwindSafe for Device
impl Send for Device
impl Sync for Device
impl Unpin for Device
impl !UnwindSafe for Device
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