From 094a0775e7f9d07d872f718e35471854c2228d87 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Wed, 3 Apr 2024 19:05:36 +0200 Subject: [PATCH] cleanup logging --- host/src/adapter.rs | 7 ++----- host/src/channel_manager.rs | 4 ++-- host/src/l2cap.rs | 18 +++++++++--------- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/host/src/adapter.rs b/host/src/adapter.rs index 5ad0427..48760d6 100644 --- a/host/src/adapter.rs +++ b/host/src/adapter.rs @@ -233,9 +233,7 @@ where } other if other >= L2CAP_CID_DYN_START => match self.channels.dispatch(packet).await { - Ok(_) => { - info!("L2CAP packet dispatched!"); - } + Ok(_) => {} Err(e) => { warn!("Error dispatching l2cap packet to channel: {:?}", e); } @@ -273,7 +271,6 @@ where Ok(ControllerToHostPacket::Event(event)) => match event { Event::Le(event) => match event { LeEvent::LeConnectionComplete(e) => { - warn!("CONNECTION COMPLET!"); if let Err(err) = self.connections.connect( e.handle, ConnectionInfo { @@ -369,7 +366,7 @@ where .await?; let ret = LeReadBufferSize::new().exec(&self.controller).await?; - info!( + trace!( "Setting max flow control packets to {}", ret.total_num_le_acl_data_packets ); diff --git a/host/src/channel_manager.rs b/host/src/channel_manager.rs index 119f0ce..7ab88d7 100644 --- a/host/src/channel_manager.rs +++ b/host/src/channel_manager.rs @@ -227,7 +227,7 @@ impl<'d, M: RawMutex, const CHANNELS: usize, const L2CAP_TXQ: usize, const L2CAP }), ); - info!("Responding to create: {:?}", response); + // info!("Responding to create: {:?}", response); controller.signal(conn, response).await?; Ok((state, self.inbound[idx].receiver().into())) @@ -310,7 +310,7 @@ impl<'d, M: RawMutex, const CHANNELS: usize, const L2CAP_TXQ: usize, const L2CAP } pub async fn control(&self, conn: ConnHandle, signal: L2capLeSignal) -> Result<(), Error> { - info!("Inbound signal: {:?}", signal); + // info!("Inbound signal: {:?}", signal); match signal.data { L2capLeSignalData::LeCreditConnReq(req) => { self.connect(ConnectingState { diff --git a/host/src/l2cap.rs b/host/src/l2cap.rs index 47ff41c..143e764 100644 --- a/host/src/l2cap.rs +++ b/host/src/l2cap.rs @@ -188,21 +188,21 @@ impl<'a, 'd, T: Controller, const MTU: usize> L2capChannel<'a, 'd, T, MTU> { let mut r = ReadCursor::new(packet.as_ref()); let remaining: u16 = r.read()?; - info!("Total expected: {}", remaining); + // info!("Total expected: {}", remaining); let data = r.remaining(); let to_copy = data.len().min(buf.len()); buf[..to_copy].copy_from_slice(&data[..to_copy]); let mut pos = to_copy; - info!("Received {} bytes so far", pos); + // info!("Received {} bytes so far", pos); let mut remaining = remaining as usize - data.len(); - info!( - "Total size of PDU is {}, read buffer size is {} remaining; {}", - len, - buf.len(), - remaining - ); + //info!( + // "Total size of PDU is {}, read buffer size is {} remaining; {}", + // len, + // buf.len(), + // remaining + //); // We have some k-frames to reassemble while remaining > 0 { let packet = self.receive_pdu().await?; @@ -218,7 +218,7 @@ impl<'a, 'd, T: Controller, const MTU: usize> L2capChannel<'a, 'd, T, MTU> { let (handle, response) = self.manager.confirm_received(self.cid, n_received)?; self.tx.signal(handle, response).await?; - info!("Total reserved {} bytes", pos); + // info!("Total reserved {} bytes", pos); Ok(pos) }