Skip to content

Commit

Permalink
apps/bttester: copy whole buffer to response of get_attr_val
Browse files Browse the repository at this point in the history
Characteristic values can be long and not fit into single os_mbuf - copy
whole chain instead.
  • Loading branch information
KKopyscinski committed Aug 1, 2023
1 parent 8da39bc commit a30c886
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/bttester/src/btp_gatt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1807,8 +1807,8 @@ get_attr_val(const void *cmd, uint16_t cmd_len,
rp->att_response = out_att_err;
rp->value_length = os_mbuf_len(buf) - sizeof(*rp);

(void)memcpy(rsp, buf->om_data, buf->om_len);
*rsp_len = buf->om_len;
os_mbuf_copydata(buf, 0, os_mbuf_len(buf), rsp);
*rsp_len = os_mbuf_len(buf);

goto free;
} else {
Expand All @@ -1825,8 +1825,8 @@ get_attr_val(const void *cmd, uint16_t cmd_len,
rp->att_response = out_att_err;
rp->value_length = os_mbuf_len(buf) - sizeof(*rp);

(void)memcpy(rsp, buf->om_data, buf->om_len);
*rsp_len = buf->om_len;
os_mbuf_copydata(buf, 0, os_mbuf_len(buf), rsp);
*rsp_len = os_mbuf_len(buf);

goto free;
}
Expand Down

0 comments on commit a30c886

Please sign in to comment.