Skip to content

Commit

Permalink
Merge pull request #602 from chegewara/master
Browse files Browse the repository at this point in the history
Quick fix
  • Loading branch information
nkolban committed Jul 10, 2018
2 parents 8980fb1 + 8cf6891 commit 11125da
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cpp_utils/BLERemoteCharacteristic.cpp
Expand Up @@ -207,7 +207,7 @@ void BLERemoteCharacteristic::gattClientEventHandler(
if(m_rawData != nullptr)
free(m_rawData);

m_rawData = calloc(evtParam->read.value_len, sizeof(uint8_t));
m_rawData = (uint8_t*) calloc(evtParam->read.value_len, sizeof(uint8_t));
memcpy(m_rawData, evtParam->read.value, evtParam->read.value_len);
} else {
m_value = "";
Expand Down Expand Up @@ -501,7 +501,7 @@ void BLERemoteCharacteristic::registerForNotify(
uint8_t val[] = {0x01, 0x00};
if(!notifications)
val[0] = 0x02;
BLERemoteDescriptor *desc = getDescriptorByUUID("0x2902");
BLERemoteDescriptor *desc = getDescriptor(BLEUUID("0x2902"));
desc->writeValue(val, 2);
} // End Register
else { // If we weren't passed a callback function, then this is an unregistration.
Expand All @@ -516,7 +516,7 @@ void BLERemoteCharacteristic::registerForNotify(
}

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

Expand Down
6 changes: 6 additions & 0 deletions cpp_utils/BLEServer.cpp
Expand Up @@ -352,6 +352,12 @@ void BLEServerCallbacks::onConnect(BLEServer* pServer) {
ESP_LOGD("BLEServerCallbacks", "<< onConnect()");
} // onConnect

void BLEServerCallbacks::onConnect(BLEServer* pServer, esp_ble_gatts_cb_param_t *param) {
ESP_LOGD("BLEServerCallbacks", ">> onConnect(): Default");
ESP_LOGD("BLEServerCallbacks", "Device: %s", BLEDevice::toString().c_str());
ESP_LOGD("BLEServerCallbacks", "<< onConnect()");
} // onConnect


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

0 comments on commit 11125da

Please sign in to comment.