Skip to content

Commit

Permalink
Fixed a bug when setting the size of the send's TX_MTU (embassy-r…
Browse files Browse the repository at this point in the history
…s#256)

* Set the TX_MTU to the L2CAP_MTU rather than the PAYLOAD_LEN.
  • Loading branch information
hicklin authored Jan 24, 2025
1 parent e1940e8 commit a1daee2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/apps/src/ble_l2cap_central.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ where
} = stack.build();

// NOTE: Modify this to match the address of the peripheral you want to connect to.
// Currently it matches the address used by the peripheral examples
// Currently, it matches the address used by the peripheral examples
let target: Address = Address::random([0xff, 0x8f, 0x1a, 0x05, 0xe4, 0xff]);

let config = ConnectConfig {
Expand All @@ -49,7 +49,7 @@ where
info!("New l2cap channel created, sending some data!");
for i in 0..10 {
let tx = [i; PAYLOAD_LEN];
ch1.send::<_, PAYLOAD_LEN>(&stack, &tx).await.unwrap();
ch1.send::<_, L2CAP_MTU>(&stack, &tx).await.unwrap();
}
info!("Sent data, waiting for them to be sent back");
let mut rx = [0; PAYLOAD_LEN];
Expand Down
2 changes: 1 addition & 1 deletion examples/apps/src/ble_l2cap_peripheral.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ where
Timer::after(Duration::from_secs(1)).await;
for i in 0..10 {
let tx = [i; PAYLOAD_LEN];
ch1.send::<_, PAYLOAD_LEN>(&stack, &tx).await.unwrap();
ch1.send::<_, L2CAP_MTU>(&stack, &tx).await.unwrap();
}
info!("L2CAP data echoed");

Expand Down

0 comments on commit a1daee2

Please sign in to comment.