From c0391dc37b5e8bd63b15c500428848aabdf659ce Mon Sep 17 00:00:00 2001 From: Paul Szczeanek Date: Mon, 13 Jul 2020 14:42:53 +0100 Subject: [PATCH] fixed size writes under size must be allowed --- .../stack/ble-host/sources/stack/att/atts_write.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_write.c b/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_write.c index 1b41582c58..fd9cd8fb3d 100644 --- a/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_write.c +++ b/features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/sources/stack/att/atts_write.c @@ -145,15 +145,9 @@ void attsProcWrite(attsCcb_t *pCcb, uint16_t len, uint8_t *pPacket) { /* err has been set; fail */ } - /* verify write length, fixed length */ - else if (((pAttr->settings & ATTS_SET_VARIABLE_LEN) == 0) && - (writeLen != pAttr->maxLen)) - { - err = ATT_ERR_LENGTH; - } - /* verify write length, variable length */ - else if (((pAttr->settings & ATTS_SET_VARIABLE_LEN) != 0) && - (writeLen > pAttr->maxLen)) + /* verify write length within max length, fixed size writes within size must be allowed + * as described in CORE SPECIFICATION Version 5.2, Vol 3, Part F, 3.4.5.1 */ + else if (writeLen > pAttr->maxLen) { err = ATT_ERR_LENGTH; }