15 #ifndef MAIN_NIMBLESERVICE_H_
16 #define MAIN_NIMBLESERVICE_H_
19 #if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BT_NIMBLE_ROLE_PERIPHERAL)
21 #include "NimBLEServer.h"
22 #include "NimBLECharacteristic.h"
23 #include "NimBLEUUID.h"
52 NIMBLE_PROPERTY::READ |
53 NIMBLE_PROPERTY::WRITE,
54 uint16_t max_len = BLE_ATT_ATTR_MAX_LEN);
58 NIMBLE_PROPERTY::READ |
59 NIMBLE_PROPERTY::WRITE,
60 uint16_t max_len = BLE_ATT_ATTR_MAX_LEN);
80 ble_gatt_svc_def* m_pSvcDef;
82 std::vector<NimBLECharacteristic*> m_chrVec;
The model of a BLE Characteristic.
Definition: NimBLECharacteristic.h:63
A model of a BLE Device from which all the BLE roles are created.
Definition: NimBLEDevice.h:96
The model of a BLE server.
Definition: NimBLEServer.h:46
The model of a BLE service.
Definition: NimBLEService.h:34
std::string toString()
Return a string representation of this service. A service is defined by:
Definition: NimBLEService.cpp:417
NimBLECharacteristic * getCharacteristic(const char *uuid, uint16_t instanceId=0)
Get a pointer to the characteristic object with the specified UUID.
Definition: NimBLEService.cpp:346
NimBLECharacteristic * getCharacteristicByHandle(uint16_t handle)
Get a pointer to the characteristic object with the specified handle.
Definition: NimBLEService.cpp:374
NimBLECharacteristic * createCharacteristic(const char *uuid, uint32_t properties=NIMBLE_PROPERTY::READ|NIMBLE_PROPERTY::WRITE, uint16_t max_len=BLE_ATT_ATTR_MAX_LEN)
Create a new BLE Characteristic associated with this service.
Definition: NimBLEService.cpp:262
NimBLEService(const char *uuid)
Construct an instance of the NimBLEService.
Definition: NimBLEService.cpp:36
void dump()
Dump details of this BLE GATT service.
Definition: NimBLEService.cpp:77
uint16_t getHandle()
Get the handle associated with this service.
Definition: NimBLEService.cpp:250
std::vector< NimBLECharacteristic * > getCharacteristics()
Definition: NimBLEService.cpp:386
NimBLEUUID getUUID()
Get the UUID of the service.
Definition: NimBLEService.cpp:101
bool start()
Builds the database of characteristics/descriptors for the service and registers it with the NimBLE s...
Definition: NimBLEService.cpp:111
NimBLEServer * getServer()
Get the BLE server associated with this service.
Definition: NimBLEService.cpp:431
void addCharacteristic(NimBLECharacteristic *pCharacteristic)
Add a characteristic to the service.
Definition: NimBLEService.cpp:291
void removeCharacteristic(NimBLECharacteristic *pCharacteristic, bool deleteChr=false)
Remove a characteristic from the service.
Definition: NimBLEService.cpp:317
A model of a BLE UUID.
Definition: NimBLEUUID.h:37