テスト用

Fork of nRF51822 by Nordic Semiconductor

Revision:
35:7174913c9d67
Parent:
34:48d24b1d2fe6
Child:
36:bd0186ce644a
diff -r 48d24b1d2fe6 -r 7174913c9d67 nRF51GattServer.cpp
--- 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;