From f5eab87a8753e82d3a5b3d526c4f71a38f11d032 Mon Sep 17 00:00:00 2001 From: h2zero Date: Wed, 31 Mar 2021 17:43:19 -0600 Subject: [PATCH] Fix missing data in long write to descriptor. --- src/NimBLEDescriptor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NimBLEDescriptor.cpp b/src/NimBLEDescriptor.cpp index 95c3291..5f3e97f 100644 --- a/src/NimBLEDescriptor.cpp +++ b/src/NimBLEDescriptor.cpp @@ -169,7 +169,7 @@ int NimBLEDescriptor::handleGapEvent(uint16_t conn_handle, uint16_t attr_handle, if((len + next->om_len) > pDescriptor->m_value.attr_max_len) { return BLE_ATT_ERR_INVALID_ATTR_VALUE_LEN; } - memcpy(&buf[len-1], next->om_data, next->om_len); + memcpy(&buf[len], next->om_data, next->om_len); len += next->om_len; next = SLIST_NEXT(next, om_next); }