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:
- 14:5ca08f962e4f
- Parent:
- 12:e151f55035b8
- Child:
- 20:b4f64efaaa2c
--- a/nRF51GattServer.cpp Thu May 29 08:57:16 2014 +0100
+++ b/nRF51GattServer.cpp Thu May 29 09:51:36 2014 +0100
@@ -57,21 +57,21 @@
for (uint8_t i = 0; i < service.characteristicCount; i++) {
GattCharacteristic *p_char = service.characteristics[i];
- nordicUUID = custom_convert_to_nordic_uuid(p_char->uuid);
+ nordicUUID = custom_convert_to_nordic_uuid(p_char->getUUID());
ASSERT ( ERROR_NONE ==
custom_add_in_characteristic(service.handle,
&nordicUUID,
- p_char->properties,
+ p_char->getProperties(),
NULL,
- p_char->lenMin,
- p_char->lenMax,
+ p_char->getMinLength(),
+ p_char->getMaxLength(),
&nrfCharacteristicHandles[
characteristicCount]),
BLE_ERROR_PARAM_OUT_OF_RANGE );
/* Update the characteristic handle */
- p_char->handle = characteristicCount;
+ p_char->setHandle(characteristicCount);
p_characteristics[characteristicCount++] = p_char;
}
@@ -161,7 +161,7 @@
BLE_ERROR_PARAM_OUT_OF_RANGE );
}
- if ((p_characteristics[charHandle]->properties &
+ if ((p_characteristics[charHandle]->getProperties() &
(GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_INDICATE |
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY)) &&
(gapConnectionHandle != BLE_CONN_HANDLE_INVALID)) {
@@ -170,7 +170,7 @@
hvx_params.handle = nrfCharacteristicHandles[charHandle].value_handle;
hvx_params.type =
- (p_characteristics[charHandle]->properties &
+ (p_characteristics[charHandle]->getProperties() &
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY) ?
BLE_GATT_HVX_NOTIFICATION : BLE_GATT_HVX_INDICATION;
hvx_params.offset = 0;
@@ -225,7 +225,7 @@
/* 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]->properties &
+ if ((p_characteristics[i]->getProperties() &
(GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_INDICATE |
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY)) &&
(nrfCharacteristicHandles[i].cccd_handle == handle_value)) {
@@ -235,10 +235,10 @@
* Little Endian but M0 may
* be mis-aligned */
- if (((p_characteristics[i]->properties &
+ if (((p_characteristics[i]->getProperties() &
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_INDICATE) &&
(cccd_value & BLE_GATT_HVX_INDICATION)) ||
- ((p_characteristics[i]->properties &
+ ((p_characteristics[i]->getProperties() &
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY) &&
(cccd_value & BLE_GATT_HVX_NOTIFICATION))) {
event = GattServerEvents::GATT_EVENT_UPDATES_ENABLED;