This commit is contained in:
richonguzman 2023-11-27 15:16:35 -03:00
parent 35cbcb2d81
commit 3fe43a8321
1 changed files with 5 additions and 3 deletions

View File

@ -44,9 +44,11 @@ class MyServerCallbacks : public NimBLEServerCallbacks {
class MyCallbacks : public NimBLECharacteristicCallbacks {
void onWrite(NimBLECharacteristic *pCharacteristic) {
//std::string receivedData = pCharacteristic->getValue(); // Read the data from the characteristic
const char * receivedData = pCharacteristic->getValue().c_str();
std::string receivedD = pCharacteristic->getValue(); // Read the data from the characteristic
Serial.println(receivedD.c_str());
const char * receivedData = receivedD.c_str();
Serial.println(receivedData);
size_t receivedLength = strlen(receivedData) + 1; // Read the data from the characteristic
char * receivedString = (char*) malloc(receivedLength);