Struct stm32wb_hci::event::command::CommandComplete
source · pub struct CommandComplete<V>where
V: VendorEvent,{
pub num_hci_command_packets: u8,
pub return_params: ReturnParameters<V>,
}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: u8Indicates 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<V>The type of command that has completed, and any parameters that it returns.
Implementations§
source§impl<V> CommandComplete<V>where
V: VendorEvent,
impl<V> CommandComplete<V>where V: VendorEvent,
sourcepub fn new(bytes: &[u8]) -> Result<CommandComplete<V>, Error<V::Error>>
pub fn new(bytes: &[u8]) -> Result<CommandComplete<V>, Error<V::Error>>
Deserializes a buffer into a CommandComplete event.
Errors
BadLengthif 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<V> Clone for CommandComplete<V>where
V: VendorEvent + Clone,
impl<V> Clone for CommandComplete<V>where V: VendorEvent + Clone,
source§fn clone(&self) -> CommandComplete<V>
fn clone(&self) -> CommandComplete<V>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more