Skip to content

Commit 11125da

Browse files
authored
Merge pull request #602 from chegewara/master
Quick fix
2 parents 8980fb1 + 8cf6891 commit 11125da

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

cpp_utils/BLERemoteCharacteristic.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ void BLERemoteCharacteristic::gattClientEventHandler(
207207
if(m_rawData != nullptr)
208208
free(m_rawData);
209209

210-
m_rawData = calloc(evtParam->read.value_len, sizeof(uint8_t));
210+
m_rawData = (uint8_t*) calloc(evtParam->read.value_len, sizeof(uint8_t));
211211
memcpy(m_rawData, evtParam->read.value, evtParam->read.value_len);
212212
} else {
213213
m_value = "";
@@ -501,7 +501,7 @@ void BLERemoteCharacteristic::registerForNotify(
501501
uint8_t val[] = {0x01, 0x00};
502502
if(!notifications)
503503
val[0] = 0x02;
504-
BLERemoteDescriptor *desc = getDescriptorByUUID("0x2902");
504+
BLERemoteDescriptor *desc = getDescriptor(BLEUUID("0x2902"));
505505
desc->writeValue(val, 2);
506506
} // End Register
507507
else { // If we weren't passed a callback function, then this is an unregistration.
@@ -516,7 +516,7 @@ void BLERemoteCharacteristic::registerForNotify(
516516
}
517517

518518
uint8_t val[] = {0x00, 0x00};
519-
BLERemoteDescriptor *desc = getDescriptorByUUID("0x2902");
519+
BLERemoteDescriptor *desc = getDescriptor(BLEUUID("0x2902"));
520520
desc->writeValue(val, 2);
521521
} // End Unregister
522522

cpp_utils/BLEServer.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,12 @@ void BLEServerCallbacks::onConnect(BLEServer* pServer) {
352352
ESP_LOGD("BLEServerCallbacks", "<< onConnect()");
353353
} // onConnect
354354

355+
void BLEServerCallbacks::onConnect(BLEServer* pServer, esp_ble_gatts_cb_param_t *param) {
356+
ESP_LOGD("BLEServerCallbacks", ">> onConnect(): Default");
357+
ESP_LOGD("BLEServerCallbacks", "Device: %s", BLEDevice::toString().c_str());
358+
ESP_LOGD("BLEServerCallbacks", "<< onConnect()");
359+
} // onConnect
360+
355361

356362
void BLEServerCallbacks::onDisconnect(BLEServer* pServer) {
357363
ESP_LOGD("BLEServerCallbacks", ">> onDisconnect(): Default");

0 commit comments

Comments
 (0)