Refactor 2904 descriptor

* General code cleanup.
* Added method `NimBLECharacteristic::create2904` which will specifically create a CPF(0x2904) descriptor.
This commit is contained in:
h2zero
2024-11-30 14:21:39 -07:00
committed by h2zero
parent 47c3cd5b84
commit b4fe046c56
5 changed files with 59 additions and 60 deletions
@@ -195,7 +195,7 @@ void app_main(void) {
* and sizes. However we must cast the returned reference to the correct type as the method
* only returns a pointer to the base NimBLEDescriptor class.
*/
NimBLE2904* pBeef2904 = (NimBLE2904*)pBeefCharacteristic->createDescriptor("2904");
NimBLE2904* pBeef2904 = pBeefCharacteristic->create2904();
pBeef2904->setFormat(NimBLE2904::FORMAT_UTF8);
pBeef2904->setCallbacks(&dscCallbacks);