Struct CommandComplete

Source
pub struct CommandComplete {
    pub num_hci_command_packets: u8,
    pub return_params: ReturnParameters,
}
Expand description

The Command Complete event is used by the Controller for most commands to transmit return status of a command and the other event parameters that are specified for the issued HCI command.

Must be specialized on the return parameters that may be returned by vendor-specific commands.

Defined in the Bluetooth spec, Vol 2, Part E, Section 7.7.14.

Fields§

§num_hci_command_packets: u8

Indicates the number of HCI command packets the Host can send to the Controller. If the Controller requires the Host to stop sending commands, num_hci_command_packets will be set to zero. To indicate to the Host that the Controller is ready to receive HCI command packets, the Controller generates a Command Complete event with return_params set to Spontaneous and num_hci_command_packets parameter set to 1 or more. Spontaneous return parameters indicates that this event is not associated with a command sent by the Host. The Controller can send a Spontaneous Command Complete event at any time to change the number of outstanding HCI command packets that the Host can send before waiting.

§return_params: ReturnParameters

The type of command that has completed, and any parameters that it returns.

Implementations§

Source§

impl CommandComplete

Source

pub fn new(bytes: &[u8]) -> Result<CommandComplete, Error>

Deserializes a buffer into a CommandComplete event.

§Errors
  • BadLength if the buffer is not large enough to contain a parameter length (1 byte) and opcode (2 bytes)
  • Returns errors that may be generated when deserializing specific events. This may be BadLength, which indicates the buffer was not large enough to contain all of the required data for the event. Some commands define other errors that indicate parameter values are invalid. The error type must be specialized on potential vendor-specific errors, though vendor-specific errors are never returned by this function.

Trait Implementations§

Source§

impl Clone for CommandComplete

Source§

fn clone(&self) -> CommandComplete

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CommandComplete

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.