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

Commit 3bcb6bd1 authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

Fix "GATT Read Multiple Variable Response" builder

0 length value is perfectly fine, and should result in just length
added into the packet.
Currently, for 0 length value we just break out of loop, and don't add
any value.
This means, that if first characetristic in response had 0 length, we
would return empty packet.

Bug: 352696105
Flag: exempt, obvious logic fix
Change-Id: Ida4f6b566cf9fa40fc5330d8084c29669ccaa608
parent da538fa2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -208,7 +208,7 @@ static void build_read_multi_rsp(tGATT_SR_CMD* p_cmd, uint16_t mtu) {

      len = std::min((size_t)p_rsp->attr_value.len, mtu - total_len);

      if (len == 0) {
      if (total_len == mtu && p_rsp->attr_value.len > 0) {
        log::verbose("Buffer space not enough for this data item, skipping");
        break;
      }