Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lulf committed Dec 19, 2024
1 parent bf8ccb6 commit 4b20ad4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions host/src/gatt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ async fn reply<'d>(
if let Some(pdu) = pdu.take() {
match result {
Ok(_) => {
// We know it has been checked, therefore this cannot fail
let att = unwrap!(AttReq::decode(pdu.as_ref()));
if let Some(pdu) = process(connection, att, server, tx_pool)? {
connection.send(pdu).await;
Expand Down Expand Up @@ -209,6 +210,7 @@ fn try_reply<'d>(
if let Some(pdu) = pdu.take() {
match result {
Ok(_) => {
// We know it has been checked, therefore this cannot fail
let att = unwrap!(AttReq::decode(pdu.as_ref()));
if let Some(pdu) = process(connection, att, server, tx_pool)? {
connection.try_send(pdu)?;
Expand Down Expand Up @@ -289,8 +291,7 @@ impl<'d> GattData<'d> {
self,
server: &'m AttributeServer<'server, M, MAX>,
) -> Result<Option<GattEvent<'d, 'm>>, Error> {
// We know it has been checked, therefore this cannot fail
let att = unwrap!(AttReq::decode(self.pdu.as_ref()));
let att = self.request();
match att {
AttReq::Write { handle, data: _ } => Ok(Some(GattEvent::Write(WriteEvent {
value_handle: handle,
Expand Down

0 comments on commit 4b20ad4

Please sign in to comment.