skip incompletely defined, read-only characteristics.

This commit is contained in:
Rohit Grover 2014-09-22 09:04:52 +01:00
parent fa3c0990e1
commit 612f3540b0

View file

@ -60,6 +60,13 @@ ble_error_t nRF51GattServer::addService(GattService &service)
for (uint8_t i = 0; i < service.getCharacteristicCount(); i++) {
GattCharacteristic *p_char = service.getCharacteristic(i);
/* skip any incompletely definied, read-only characteristics. */
if ((p_char->getValueAttribute().getValuePtr() == NULL) &&
(p_char->getValueAttribute().getInitialLength() == 0) &&
(p_char->getProperties() == GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ)) {
continue;
}
nordicUUID = custom_convert_to_nordic_uuid(p_char->getValueAttribute().getUUID());
ASSERT ( ERROR_NONE ==