From e08b200eef34924456c3012a13e249c54ef559d0 Mon Sep 17 00:00:00 2001 From: Nick Date: Tue, 12 Mar 2019 18:49:45 -0400 Subject: [PATCH 1/2] Adding variable length attributes to Maxim Feather --- .../FEATURE_BLE/targets/TARGET_Maxim/MaximGattServer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/features/FEATURE_BLE/targets/TARGET_Maxim/MaximGattServer.cpp b/features/FEATURE_BLE/targets/TARGET_Maxim/MaximGattServer.cpp index 6cb862c191..fc75a75a95 100644 --- a/features/FEATURE_BLE/targets/TARGET_Maxim/MaximGattServer.cpp +++ b/features/FEATURE_BLE/targets/TARGET_Maxim/MaximGattServer.cpp @@ -146,6 +146,12 @@ ble_error_t MaximGattServer::addService_(GattService &service) currAtt->pLen = p_char->getValueAttribute().getLengthPtr(); currAtt->maxLen = p_char->getValueAttribute().getMaxLength(); currAtt->settings = ATTS_SET_WRITE_CBACK | ATTS_SET_READ_CBACK; + + if(p_char->getValueAttribute().hasVariableLength()) + { + currAtt->settings |= ATTS_SET_VARIABLE_LEN; + } + if (p_char->getValueAttribute().getUUID().shortOrLong() == UUID::UUID_TYPE_LONG) { currAtt->settings |= ATTS_SET_UUID_128; } From 44c5c7ef5ab6460f107f4fe44ad4e09a3b8f3fd0 Mon Sep 17 00:00:00 2001 From: Nick Date: Wed, 13 Mar 2019 07:58:24 -0400 Subject: [PATCH 2/2] Formatting fix --- .../FEATURE_BLE/targets/TARGET_Maxim/MaximGattServer.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/features/FEATURE_BLE/targets/TARGET_Maxim/MaximGattServer.cpp b/features/FEATURE_BLE/targets/TARGET_Maxim/MaximGattServer.cpp index fc75a75a95..8430238d81 100644 --- a/features/FEATURE_BLE/targets/TARGET_Maxim/MaximGattServer.cpp +++ b/features/FEATURE_BLE/targets/TARGET_Maxim/MaximGattServer.cpp @@ -147,11 +147,10 @@ ble_error_t MaximGattServer::addService_(GattService &service) currAtt->maxLen = p_char->getValueAttribute().getMaxLength(); currAtt->settings = ATTS_SET_WRITE_CBACK | ATTS_SET_READ_CBACK; - if(p_char->getValueAttribute().hasVariableLength()) - { + if(p_char->getValueAttribute().hasVariableLength()) { currAtt->settings |= ATTS_SET_VARIABLE_LEN; } - + if (p_char->getValueAttribute().getUUID().shortOrLong() == UUID::UUID_TYPE_LONG) { currAtt->settings |= ATTS_SET_UUID_128; }