Nordic stack and drivers for the mbed BLE API
Fork of nRF51822 by
Diff: btle/custom/custom_helper.cpp
- Revision:
- 119:3ba3e377b972
- Parent:
- 109:425faebc8201
- Child:
- 126:e6114201f092
diff -r f9e5e2935c5c -r 3ba3e377b972 btle/custom/custom_helper.cpp --- a/btle/custom/custom_helper.cpp Thu Apr 30 08:34:38 2015 +0100 +++ b/btle/custom/custom_helper.cpp Thu Apr 30 08:34:38 2015 +0100 @@ -203,6 +203,8 @@ uint8_t *p_data, uint16_t min_length, uint16_t max_length, + const uint8_t *userDescriptionDescriptorValuePtr, + uint16_t userDescriptionDescriptorValueLen, bool readAuthorization, bool writeAuthorization, ble_gatts_char_handles_t *p_char_handle) @@ -226,6 +228,11 @@ char_md.char_props = char_props; char_md.p_cccd_md = (char_props.notify || char_props.indicate) ? &cccd_md : NULL; + if ((userDescriptionDescriptorValueLen > 0) && (userDescriptionDescriptorValuePtr != NULL)) { + char_md.p_char_user_desc = const_cast<uint8_t *>(userDescriptionDescriptorValuePtr); + char_md.char_user_desc_max_size = userDescriptionDescriptorValueLen; + char_md.char_user_desc_size = userDescriptionDescriptorValueLen; + } /* Attribute declaration */ ble_gatts_attr_md_t attr_md = {0};