From 3fe43a8321dbdd1bb04bdead7de7b31a21d2bf74 Mon Sep 17 00:00:00 2001 From: richonguzman Date: Mon, 27 Nov 2023 15:16:35 -0300 Subject: [PATCH] test --- src/ble_utils.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ble_utils.cpp b/src/ble_utils.cpp index 3c67b6e..69bac14 100644 --- a/src/ble_utils.cpp +++ b/src/ble_utils.cpp @@ -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);