diff --git a/src/vendor/command/hal.rs b/src/vendor/command/hal.rs index a2973fd..79ce2b0 100644 --- a/src/vendor/command/hal.rs +++ b/src/vendor/command/hal.rs @@ -180,7 +180,9 @@ pub trait HalCommands { /// This command stops a previous [HAL Rx Start](HalCommands::rx_start) command async fn rx_stop(&mut self); - // TODO: stack_reset + /// This command is equivalent to [HCI Reset](crate::host::HostHci::reset) but ensures + /// the sleep mode is entered immediately after its completion. + async fn stack_reset(&mut self); } impl HalCommands for T { @@ -296,6 +298,11 @@ impl HalCommands for T { self.controller_write(crate::vendor::opcode::HAL_RX_STOP, &[]) .await; } + + async fn stack_reset(&mut self) { + self.controller_write(crate::vendor::opcode::HAL_STACK_RESET, &[]) + .await; + } } /// Potential errors from parameter validation. diff --git a/src/vendor/opcode.rs b/src/vendor/opcode.rs index 9854ede..829cc7d 100644 --- a/src/vendor/opcode.rs +++ b/src/vendor/opcode.rs @@ -45,6 +45,7 @@ vendor_opcodes! { pub const HAL_READ_RAW_RSSI = 0x32; pub const HAL_RX_START = 0x33; pub const HAL_RX_STOP = 0x34; + pub const HAL_STACK_RESET = 0x3B; } Gap = 0x1; {