Conditionally compile code for specific roles.

This allows NimBLE options in menuconfig to reduce code size based on
the roles selected (scan/advertising/central/peripheral).

Significant code space can be saved by removing unnecessary roles for the application.
This commit is contained in:
h2zero committed 2020-05-13 22:03:56 -06:00
1 parent 3d6f8b691e
commit 03cb7b21d9
53 files changed
+2335 -2012

No files matched your search

+8 -3
View File
@@ -3,7 +3,7 @@
*
* Created: on Jan 27 2020
* Author H2zero
*
*
* Originally:
*
* BLERemoteCharacteristic.h
@@ -17,6 +17,9 @@
#include "sdkconfig.h"
#if defined(CONFIG_BT_ENABLED)
#include "nimconfig.h"
#if defined( CONFIG_BT_NIMBLE_ROLE_CENTRAL)
//#include "NimBLEUUID.h"
//#include "FreeRTOS.h"
#include "NimBLERemoteService.h"
@@ -66,7 +69,7 @@ public:
private:
NimBLERemoteCharacteristic(NimBLERemoteService *pRemoteservice, const struct ble_gatt_chr *chr);
friend class NimBLEClient;
friend class NimBLERemoteService;
friend class NimBLERemoteDescriptor;
@@ -80,7 +83,7 @@ private:
static int descriptorDiscCB(uint16_t conn_handle, const struct ble_gatt_error *error,
uint16_t chr_val_handle, const struct ble_gatt_dsc *dsc,
void *arg);
// Private properties
NimBLEUUID m_uuid;
uint8_t m_charProp;
@@ -98,5 +101,7 @@ private:
// We maintain a map of descriptors owned by this characteristic keyed by a string representation of the UUID.
std::map<std::string, NimBLERemoteDescriptor*> m_descriptorMap;
}; // BLERemoteCharacteristic
#endif // #if defined( CONFIG_BT_NIMBLE_ROLE_CENTRAL)
#endif /* CONFIG_BT_ENABLED */
#endif /* COMPONENTS_NIMBLEREMOTECHARACTERISTIC_H_ */