Skip to content

Commit

Permalink
feat(vendor HAL command): add Stack Reset command
Browse files Browse the repository at this point in the history
  • Loading branch information
OueslatiGhaith committed Jan 8, 2024
1 parent 6c6ece2 commit 16d3495
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/vendor/command/hal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T: Controller> HalCommands for T {
Expand Down Expand Up @@ -296,6 +298,11 @@ impl<T: Controller> 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.
Expand Down
1 change: 1 addition & 0 deletions src/vendor/opcode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
{
Expand Down

0 comments on commit 16d3495

Please sign in to comment.