Skip to content

Commit

Permalink
cleanup logging
Browse files Browse the repository at this point in the history
  • Loading branch information
lulf committed Apr 3, 2024
1 parent cf44334 commit 094a077
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
7 changes: 2 additions & 5 deletions host/src/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
);
Expand Down
4 changes: 2 additions & 2 deletions host/src/channel_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
Expand Down Expand Up @@ -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 {
Expand Down
18 changes: 9 additions & 9 deletions host/src/l2cap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?;
Expand All @@ -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)
}

Expand Down

0 comments on commit 094a077

Please sign in to comment.