forked from h2zero/esp-nimble-cpp
[Server] Add ability to create static attributes.
This allows creating instances of services/characteristics and decriptors without needing to call the parent createX() methods. This allows creation of the attibutes within a class or other structure and the attributes can be linked to the parent by calling the parent addX() method. Additonally this increases the backward compatibility with the original bluedroid library to further support user migration.
This commit is contained in:
@@ -246,6 +246,11 @@ NimBLECharacteristic* NimBLEService::createCharacteristic(const NimBLEUUID &uuid
|
||||
} // createCharacteristic
|
||||
|
||||
|
||||
void NimBLEService::addCharacteristic(NimBLECharacteristic* pCharacteristic) {
|
||||
pCharacteristic->setService(this);
|
||||
m_chrVec.push_back(pCharacteristic);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get a pointer to the characteristic object with the specified UUID.
|
||||
* @param [in] uuid The UUID of the characteristic.
|
||||
|
||||
Reference in New Issue
Block a user