This is an automated email from the ASF dual-hosted git repository.

janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git


The following commit(s) were added to refs/heads/master by this push:
     new 3c4bc60c apps/bttester: copy whole buffer to response of get_attr_val
3c4bc60c is described below

commit 3c4bc60cae01fa19091749f67cf08403c2807491
Author: Krzysztof Kopyściński <[email protected]>
AuthorDate: Tue Aug 1 13:44:22 2023 +0200

    apps/bttester: copy whole buffer to response of get_attr_val
    
    Characteristic values can be long and not fit into single os_mbuf - copy
    whole chain instead.
---
 apps/bttester/src/btp_gatt.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/apps/bttester/src/btp_gatt.c b/apps/bttester/src/btp_gatt.c
index c96593a3..1c632051 100644
--- a/apps/bttester/src/btp_gatt.c
+++ b/apps/bttester/src/btp_gatt.c
@@ -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 {
@@ -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;
     }

Reply via email to