summaryrefslogtreecommitdiff
path: root/offload
diff options
context:
space:
mode:
author Antoine Soulier <asoulier@google.com> 2025-03-04 11:45:40 -0800
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2025-03-04 11:45:40 -0800
commit10cf7ae5abf5a0d60a703210b1c0b4af52d9916a (patch)
tree695e68253221bb120701fadad4beb650008c34d0 /offload
parent11c397567f0be86799796f898f9828f2cbb5ad42 (diff)
parentdb2b2881f19d4143b6c928f4329e1dc6877844a9 (diff)
Merge "LE Audio Software Offload: Fix panic_const_rem_by_zero crash." into main
Diffstat (limited to 'offload')
-rw-r--r--offload/leaudio/hci/proxy.rs32
1 files changed, 17 insertions, 15 deletions
diff --git a/offload/leaudio/hci/proxy.rs b/offload/leaudio/hci/proxy.rs
index 79e45f06e1..604bde356d 100644
--- a/offload/leaudio/hci/proxy.rs
+++ b/offload/leaudio/hci/proxy.rs
@@ -16,8 +16,7 @@ use bluetooth_offload_hci as hci;
use crate::arbiter::Arbiter;
use crate::service::{Service, StreamConfiguration};
-use hci::{Command, Event, EventToBytes, IsoData, ReturnParameters, Status};
-use hci::{Module, ModuleBuilder};
+use hci::{Command, Event, EventToBytes, IsoData, Module, ModuleBuilder, ReturnParameters, Status};
use std::collections::HashMap;
use std::sync::{Arc, Mutex};
@@ -82,19 +81,22 @@ impl Stream {
fn new_cis(cig: &CigParameters, e: &hci::LeCisEstablished) -> Self {
let iso_interval_us = (e.iso_interval as u32) * 1250;
- assert_eq!(iso_interval_us % cig.sdu_interval_c_to_p, 0, "Framing mode not supported");
- assert_eq!(iso_interval_us % cig.sdu_interval_p_to_c, 0, "Framing mode not supported");
-
- assert_eq!(
- iso_interval_us / cig.sdu_interval_c_to_p,
- e.bn_c_to_p.into(),
- "SDU fragmentation not supported"
- );
- assert_eq!(
- iso_interval_us / cig.sdu_interval_p_to_c,
- e.bn_p_to_c.into(),
- "SDU fragmentation not supported"
- );
+ if cig.sdu_interval_c_to_p != 0 {
+ assert_eq!(iso_interval_us % cig.sdu_interval_c_to_p, 0, "Framing mode not supported");
+ assert_eq!(
+ iso_interval_us / cig.sdu_interval_c_to_p,
+ e.bn_c_to_p.into(),
+ "SDU fragmentation not supported"
+ );
+ }
+ if cig.sdu_interval_p_to_c != 0 {
+ assert_eq!(iso_interval_us % cig.sdu_interval_p_to_c, 0, "Framing mode not supported");
+ assert_eq!(
+ iso_interval_us / cig.sdu_interval_p_to_c,
+ e.bn_p_to_c.into(),
+ "SDU fragmentation not supported"
+ );
+ }
Self {
state: StreamState::Disabled,