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(
11501150
11511151 /* if new data provided copy into the attribute value buffer */
11521152 if (read_auth_params.data ) {
1153-
11541153 if (read_auth_params.len > pAttr->maxLen ) {
11551154 tr_error (" Read authorisation callback set length larger than maximum attribute length, "
11561155 " cannot copy data" );
11571156 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 ;
11621160
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+ }
11671166 }
11681167 }
11691168 }
You can’t perform that action at this time.
0 commit comments