BLE
Fork of BLE_API by
Diff: source/DiscoveredCharacteristic.cpp
- Revision:
- 1046:b9d15970040f
- Parent:
- 1043:21a86ac7f5b1
- Child:
- 1048:2d66d38d9ac9
--- a/source/DiscoveredCharacteristic.cpp Mon Jan 11 08:51:26 2016 +0000 +++ b/source/DiscoveredCharacteristic.cpp Mon Jan 11 08:51:26 2016 +0000 @@ -59,8 +59,17 @@ return gattc->write(GattClient::GATT_OP_WRITE_CMD, connHandle, valueHandle, length, value); } -ble_error_t -DiscoveredCharacteristic::discoverDescriptors(DescriptorCallback_t callback, const UUID &matchingUUID) const -{ - return BLE_ERROR_NOT_IMPLEMENTED; /* TODO: this needs to be filled in. */ +ble_error_t DiscoveredCharacteristic::discoverDescriptors( + CharacteristicDescriptorDiscovery::DiscoveryCallback_t onCharacteristicDiscovered, + CharacteristicDescriptorDiscovery::TerminationCallback_t onTermination) const { + + if(!gattc) { + return BLE_ERROR_INVALID_STATE; + } + + ble_error_t err = gattc->discoverCharacteristicDescriptors( + *this, onCharacteristicDiscovered, onTermination + ); + + return err; } \ No newline at end of file