[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:
h2zero
2021-05-23 13:07:00 -06:00
parent 30d6c399b8
commit d9d794ae40
8 changed files with 103 additions and 52 deletions
+5
View File
@@ -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.