mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2024-05-20 16:01:20 +02:00
Compare commits
3 commits
318103435c
...
7f6640203c
Author | SHA1 | Date | |
---|---|---|---|
7f6640203c | |||
226c67f729 | |||
65269cff7d |
|
@ -236,15 +236,14 @@ NimBLEUUID NimBLECharacteristic::getUUID() {
|
|||
* @brief Retrieve the current value of the characteristic.
|
||||
* @return The NimBLEAttValue containing the current characteristic value.
|
||||
*/
|
||||
NimBLEAttValue NimBLECharacteristic::getValue(time_t *timestamp) {
|
||||
NimBLEAttValue* NimBLECharacteristic::getValue(time_t *timestamp) {
|
||||
if(timestamp != nullptr) {
|
||||
m_value.getValue(timestamp);
|
||||
}
|
||||
|
||||
return m_value;
|
||||
return &m_value;
|
||||
} // getValue
|
||||
|
||||
|
||||
/**
|
||||
* @brief Retrieve the the current data length of the characteristic.
|
||||
* @return The length of the current characteristic data.
|
||||
|
|
|
@ -95,7 +95,7 @@ public:
|
|||
void removeDescriptor(NimBLEDescriptor *pDescriptor, bool deleteDsc = false);
|
||||
NimBLEService* getService();
|
||||
uint16_t getProperties();
|
||||
NimBLEAttValue getValue(time_t *timestamp = nullptr);
|
||||
NimBLEAttValue* getValue(time_t *timestamp = nullptr);
|
||||
size_t getDataLength();
|
||||
void setValue(const uint8_t* data, size_t size);
|
||||
void setValue(const std::vector<uint8_t>& vec);
|
||||
|
|
|
@ -159,7 +159,7 @@ bool NimBLEService::start() {
|
|||
// Nimble requires the last characteristic to have it's uuid = 0 to indicate the end
|
||||
// of the characteristics for the service. We create 1 extra and set it to null
|
||||
// for this purpose.
|
||||
pChr_a = new ble_gatt_chr_def[numChrs + 1];
|
||||
pChr_a = new ble_gatt_chr_def[numChrs + 1]{};
|
||||
int i = 0;
|
||||
for(auto chr_it = m_chrVec.begin(); chr_it != m_chrVec.end(); ++chr_it) {
|
||||
if((*chr_it)->m_removed > 0) {
|
||||
|
|
Loading…
Reference in a new issue