From 9fd84a1fb96afbf59814c2e05422d810f79751de Mon Sep 17 00:00:00 2001 From: OueslatiGhaith Date: Mon, 8 Jan 2024 08:26:27 +0100 Subject: [PATCH] feat(vendor HAL command): add Get PM Debug Info command --- src/vendor/command/hal.rs | 16 +++++++++++++++- src/vendor/opcode.rs | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/vendor/command/hal.rs b/src/vendor/command/hal.rs index b6a6c71..de22068 100644 --- a/src/vendor/command/hal.rs +++ b/src/vendor/command/hal.rs @@ -153,13 +153,22 @@ pub trait HalCommands { /// that will be enabled. async fn set_event_mask(&mut self, mask: HalEventFlags); - // TODO: get_pm_debug_info + /// This command is used to retreive Tx, Rx, and total buffer count allocated for ACL packets. + // TODO: this command returns an event, check if it exists + async fn get_pm_debug_info(&mut self); + // TODO: set_peripheral_latency + // TODO: read_rssi + // TODO: read_radio_reg + // TODO: read_raw_rssi + // TODO: rx_start + // TODO: rx_stop + // TODO: stack_reset } @@ -238,6 +247,11 @@ impl HalCommands for T { self.controller_write(crate::vendor::opcode::HAL_SET_EVENT_MASK, &payload) .await; } + + async fn get_pm_debug_info(&mut self) { + self.controller_write(crate::vendor::opcode::HAL_GET_PM_DEBUG_INFO, &[]) + .await; + } } /// Potential errors from parameter validation. diff --git a/src/vendor/opcode.rs b/src/vendor/opcode.rs index eee01f5..c353ff6 100644 --- a/src/vendor/opcode.rs +++ b/src/vendor/opcode.rs @@ -38,6 +38,7 @@ vendor_opcodes! { // length (7 bits). The C source code has 0x19, which is valid. pub const HAL_GET_ANCHOR_PERIOD = 0x19; pub const HAL_SET_EVENT_MASK = 0x1A; + pub const HAL_GET_PM_DEBUG_INFO = 0x1C; } Gap = 0x1; {