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.
Dependencies: nrf51-sdk
Dependents: microbit-dal microbit-ble-open microbit-dal-eddystone microbit-dal-ble-accelerometer-example ... more
Diff: nRF51GattServer.cpp
- Revision:
- 35:7174913c9d67
- Parent:
- 34:48d24b1d2fe6
- Child:
- 36:bd0186ce644a
--- a/nRF51GattServer.cpp Fri Jun 27 13:53:59 2014 +0100
+++ b/nRF51GattServer.cpp Fri Jun 27 13:58:12 2014 +0100
@@ -210,20 +210,14 @@
/* 1.) Handle CCCD changes */
handle_value = p_ble_evt->evt.gatts_evt.params.write.handle;
for (uint8_t i = 0; i<characteristicCount; i++) {
- if ((p_characteristics[i]->getProperties() &
- (GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_INDICATE |
- GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY)) &&
- (nrfCharacteristicHandles[i].cccd_handle == handle_value)) {
+ if ((p_characteristics[i]->getProperties() & (GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_INDICATE | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY)) &&
+ (nrfCharacteristicHandles[i].cccd_handle == handle_value)) {
uint16_t cccd_value =
(p_ble_evt->evt.gatts_evt.params.write.data[1] << 8) |
p_ble_evt->evt.gatts_evt.params.write.data[0]; /* Little Endian but M0 may be mis-aligned */
- if (((p_characteristics[i]->getProperties() &
- GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_INDICATE) &&
- (cccd_value & BLE_GATT_HVX_INDICATION)) ||
- ((p_characteristics[i]->getProperties() &
- GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY) &&
- (cccd_value & BLE_GATT_HVX_NOTIFICATION))) {
+ if (((p_characteristics[i]->getProperties() & GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_INDICATE) && (cccd_value & BLE_GATT_HVX_INDICATION)) ||
+ ((p_characteristics[i]->getProperties() & GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY) && (cccd_value & BLE_GATT_HVX_NOTIFICATION))) {
event = GattServerEvents::GATT_EVENT_UPDATES_ENABLED;
} else {
event = GattServerEvents::GATT_EVENT_UPDATES_DISABLED;