File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
connectivity/FEATURE_BLE/source/cordio/source Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -1150,20 +1150,19 @@ uint8_t GattServer::atts_read_cb(
1150
1150
1151
1151
/* if new data provided copy into the attribute value buffer */
1152
1152
if (read_auth_params.data ) {
1153
-
1154
1153
if (read_auth_params.len > pAttr->maxLen ) {
1155
1154
tr_error (" Read authorisation callback set length larger than maximum attribute length, "
1156
1155
" cannot copy data" );
1157
1156
err = ATT_ERR_UNLIKELY;
1158
- }
1159
-
1160
- memcpy (pAttr->pValue , read_auth_params.data , read_auth_params.len );
1161
- *pAttr->pLen = read_auth_params.len ;
1157
+ } else {
1158
+ memcpy (pAttr->pValue , read_auth_params.data , read_auth_params.len );
1159
+ *pAttr->pLen = read_auth_params.len ;
1162
1160
1163
- if (read_auth_params.len < offset) {
1164
- tr_warning (" Read authorisation callback shortened data beyond current offset, "
1165
- " current read will fail" );
1166
- err = ATT_ERR_OFFSET;
1161
+ if (read_auth_params.len < offset) {
1162
+ tr_warning (" Read authorisation callback shortened data beyond current offset, "
1163
+ " current read will fail" );
1164
+ err = ATT_ERR_OFFSET;
1165
+ }
1167
1166
}
1168
1167
}
1169
1168
}
You can’t perform that action at this time.
0 commit comments