10000 Quick fix by chegewara · Pull Request #602 · nkolban/esp32-snippets · GitHub
[go: up one dir, main page]

Skip to content

Quick fix #602

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Quick fix
  • Loading branch information
chegewara committed Jul 10, 2018
commit 8cf68913ef4e4d82106544ed7f333c1b1fe9cbb4
6 changes: 3 additions & 3 deletions cpp_utils/BLERemoteCharacteristic.cpp
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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