Add method to get the callbacks from a characteristic.

This is useul to be able to unit/integration test the behavior of a
characteristic.
This commit is contained in:
Ketan Padegaonkar 2021-05-19 22:21:05 -06:00 committed by h2zero
parent 946b971750
commit 9fa9531e50
2 changed files with 9 additions and 0 deletions

View file

@ -444,6 +444,13 @@ void NimBLECharacteristic::setCallbacks(NimBLECharacteristicCallbacks* pCallback
} }
} // setCallbacks } // setCallbacks
/**
* @brief Get the callback handlers for this characteristic.
*/
NimBLECharacteristicCallbacks* NimBLECharacteristic::getCallbacks() {
return m_pCallbacks;
} //getCallbacks
/** /**
* @brief Set the value of the characteristic. * @brief Set the value of the characteristic.

View file

@ -65,6 +65,8 @@ public:
std::string toString(); std::string toString();
void setCallbacks(NimBLECharacteristicCallbacks* pCallbacks); void setCallbacks(NimBLECharacteristicCallbacks* pCallbacks);
NimBLECharacteristicCallbacks*
getCallbacks();
void indicate(); void indicate();
void notify(bool is_notification = true); void notify(bool is_notification = true);