nordic
Fork of nRF51822 by
Diff: source/nRF5xGattClient.h
- Revision:
- 576:7023a8204a1b
- Parent:
- 572:bbf6410b6a89
- Child:
- 591:3bdd5346ded1
--- a/source/nRF5xGattClient.h Mon Jan 11 10:19:23 2016 +0000 +++ b/source/nRF5xGattClient.h Mon Jan 11 10:19:24 2016 +0000 @@ -23,8 +23,6 @@ class nRF5xGattClient : public GattClient { public: - static nRF5xGattClient &getInstance(); - /** * When using S110, all Gatt client features will return * BLE_ERROR_NOT_IMPLEMENTED @@ -147,7 +145,30 @@ } } + /** + * @brief Clear nRF5xGattClient's state. + * + * @return + * BLE_ERROR_NONE if successful. + */ + virtual ble_error_t reset(void) { + /* Clear all state that is from the parent, including private members */ + if (GattClient::reset() != BLE_ERROR_NONE) { + return BLE_ERROR_INVALID_STATE; + } + + /* Clear derived class members */ + discovery.reset(); + + return BLE_ERROR_NONE; + } + public: + /* + * Allow instantiation from nRF5xn when required. + */ + friend class nRF5xn; + nRF5xGattClient() : discovery(this) { /* empty */ }