[][src]Struct hciraw::addr::HciSocketAddr

pub struct HciSocketAddr { /* fields omitted */ }

A HCI socket address.

Methods

impl HciSocketAddr[src]

pub fn new(dev: Option<u16>, chan: HciChannel) -> HciSocketAddr[src]

Create HCI socket address.

The HCI socket address is characterized by a device and a channel. The following rules apply:

  • Device must be set to None for channels: Monitor, Control, Logging
  • Device must be set to a valid Bluetooth controller ID for channels: Raw, User

Example

Create HCI socket address associated with no device and control channel

use hciraw::{HciSocketAddr, HciChannel};

let addr = HciSocketAddr::new(None, HciChannel::Control);

Create HCI socket address associated with Bluetooth controller 0 and the raw channel

use hciraw::{HciSocketAddr, HciChannel};

let addr = HciSocketAddr::new(Some(0), HciChannel::Raw);

pub fn len(self) -> socklen_t[src]

Get the length of the data in bytes. It is always 0x5 for HciSocketAddr.

Trait Implementations

impl Clone for HciSocketAddr[src]

impl Copy for HciSocketAddr[src]

impl From<HciSocketAddr> for sockaddr[src]

impl ToHciSocketAddr for HciSocketAddr[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.