diff --git a/nRF51GattServer.cpp b/nRF51GattServer.cpp index 50590a5..1c3be1a 100644 --- a/nRF51GattServer.cpp +++ b/nRF51GattServer.cpp @@ -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 ==