Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: microbit-dal microbit-dal microbit-ble-open microbit-dal ... more
Fork of BLE_API by
Diff: public/GattCharacteristic.h
- Revision:
- 355:58a4b9423365
- Parent:
- 354:cfe0a8bafaaa
- Child:
- 360:7d37e1adef33
--- a/public/GattCharacteristic.h Fri May 08 15:35:46 2015 +0100
+++ b/public/GattCharacteristic.h Fri May 08 15:35:46 2015 +0100
@@ -290,7 +290,7 @@
uint16_t gatt_nsdesc; /**< Namespace description from Bluetooth Assigned Numbers, normally '0', see @ref BLE_GATT_CPF_NAMESPACES. */
} presentation_format_t;
- enum ble_gatt_char_required_security_t {
+ enum SecurityMode_t {
SECURITY_MODE_ENCRYPTION_OPEN_LINK = 0x00, /**< Set security mode to require no protection, open link. */
SECURITY_MODE_ENCRYPTION_NO_MITM = 0x01, /**< Set security mode to require encryption, but no MITM protection. */
SECURITY_MODE_ENCRYPTION_WITH_MITM = 0x02, /**< Set security mode to require encryption and MITM protection. */
@@ -354,7 +354,7 @@
*
* @param securityMode Can be one of encryption or signing, with or without protection for MITM (man in the middle attacks).
*/
- void requireSecurity(ble_gatt_char_required_security_t securityMode) {
+ void requireSecurity(SecurityMode_t securityMode) {
_requiredSecurity = securityMode;
}
@@ -429,7 +429,7 @@
const GattAttribute& getValueAttribute() const {return _valueAttribute; }
GattAttribute::Handle_t getValueHandle(void) const {return getValueAttribute().getHandle();}
uint8_t getProperties(void) const {return _properties; }
- ble_gatt_char_required_security_t getRequiredSecurity() const {return _requiredSecurity; }
+ SecurityMode_t getRequiredSecurity() const {return _requiredSecurity; }
uint8_t getDescriptorCount(void) const {return _descriptorCount; }
bool isReadAuthorizationEnabled() const {return enabledReadAuthorization; }
bool isWriteAuthorizationEnabled() const {return enabledWriteAuthorization; }
@@ -443,14 +443,14 @@
}
private:
- GattAttribute _valueAttribute;
- uint8_t _properties;
- ble_gatt_char_required_security_t _requiredSecurity;
- GattAttribute **_descriptors;
- uint8_t _descriptorCount;
+ GattAttribute _valueAttribute;
+ uint8_t _properties;
+ SecurityMode_t _requiredSecurity;
+ GattAttribute **_descriptors;
+ uint8_t _descriptorCount;
- bool enabledReadAuthorization;
- bool enabledWriteAuthorization;
+ bool enabledReadAuthorization;
+ bool enabledWriteAuthorization;
FunctionPointerWithContext<GattCharacteristicReadAuthCBParams *> readAuthorizationCallback;
FunctionPointerWithContext<GattCharacteristicWriteAuthCBParams *> writeAuthorizationCallback;
