Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bad21c8e authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

GATT multi read: account for length for variable length read

The response will contain length, then the bytes with actual content.
Account for the 2 byte length field when computing how much data can be
squezed into a packet.

Bug: 227618988
Test: compilation
Change-Id: I6ddee3e5c50ce395fa4cc1b538d256a406a415f0
parent 4524092d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -178,6 +178,9 @@ static void build_read_multi_rsp(tGATT_SR_CMD* p_cmd, uint16_t mtu) {

    if (p_rsp != NULL) {
      total_len = (p_buf->len + p_rsp->attr_value.len);
      if (p_cmd->multi_req.variable_len) {
        total_len += 2;
      }

      if (total_len > mtu) {
        /* just send the partial response for the overflow case */