1// Copyright 2022 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
45use crate::prelude_internal::*;
67/// This structure represents radio coexistence metrics.
8///
9/// Functional equivalent of [`otsys::otRadioCoexMetrics`](crate::otsys::otRadioCoexMetrics).
10#[derive(Debug, Default, Clone)]
11#[repr(transparent)]
12pub struct RadioCoexMetrics(pub otRadioCoexMetrics);
1314impl_ot_castable!(RadioCoexMetrics, otRadioCoexMetrics);
1516impl RadioCoexMetrics {
17/// Number of grant glitches.
18pub fn num_grant_glitch(&self) -> u32 {
19self.0.mNumGrantGlitch
20 }
2122/// Number of tx requests.
23pub fn num_tx_request(&self) -> u32 {
24self.0.mNumTxRequest
25 }
2627/// Number of tx requests while grant was active.
28pub fn num_tx_grant_immediate(&self) -> u32 {
29self.0.mNumTxGrantImmediate
30 }
3132/// Number of tx requests while grant was inactive.
33pub fn num_tx_grant_wait(&self) -> u32 {
34self.0.mNumTxGrantWait
35 }
3637/// Number of tx requests while grant was inactive that were ultimately granted.
38pub fn num_tx_grant_wait_activated(&self) -> u32 {
39self.0.mNumTxGrantWaitActivated
40 }
4142/// Number of tx requests while grant was inactive that timed out.
43pub fn num_tx_grant_wait_timeout(&self) -> u32 {
44self.0.mNumTxGrantWaitTimeout
45 }
4647/// Number of tx that were in progress when grant was deactivated.
48pub fn num_tx_grant_deactivated_during_request(&self) -> u32 {
49self.0.mNumTxGrantDeactivatedDuringRequest
50 }
5152/// Number of tx requests that were not granted within 50us.
53pub fn num_tx_delayed_grant(&self) -> u32 {
54self.0.mNumTxDelayedGrant
55 }
5657/// Average time in usec from tx request to grant.
58pub fn avg_tx_request_to_grant_time(&self) -> u32 {
59self.0.mAvgTxRequestToGrantTime
60 }
6162/// Number of rx requests.
63pub fn num_rx_request(&self) -> u32 {
64self.0.mNumRxRequest
65 }
6667/// Number of rx requests while grant was active.
68pub fn num_rx_grant_immediate(&self) -> u32 {
69self.0.mNumRxGrantImmediate
70 }
7172/// Number of rx requests while grant was inactive.
73pub fn num_rx_grant_wait(&self) -> u32 {
74self.0.mNumRxGrantWait
75 }
7677/// Number of rx requests while grant was inactive that were ultimately granted.
78pub fn num_rx_grant_wait_activated(&self) -> u32 {
79self.0.mNumRxGrantWaitActivated
80 }
8182/// Number of rx requests while grant was inactive that timed out.
83pub fn num_rx_grant_wait_timeout(&self) -> u32 {
84self.0.mNumRxGrantWaitTimeout
85 }
8687/// Number of rx that were in progress when grant was deactivated.
88pub fn num_rx_grant_deactivated_during_request(&self) -> u32 {
89self.0.mNumRxGrantDeactivatedDuringRequest
90 }
9192/// Number of rx requests that were not granted within 50us.
93pub fn num_rx_delayed_grant(&self) -> u32 {
94self.0.mNumRxDelayedGrant
95 }
9697/// Average time in usec from rx request to grant.
98pub fn avg_rx_request_to_grant_time(&self) -> u32 {
99self.0.mAvgRxRequestToGrantTime
100 }
101102/// Number of rx requests that completed without receiving grant.
103pub fn num_rx_grant_none(&self) -> u32 {
104self.0.mNumRxGrantNone
105 }
106107/// Stats collection stopped due to saturation.
108pub fn stopped(&self) -> bool {
109self.0.mStopped
110 }
111}