Receiving string data via BLE

I want to see Text data from esp32 via BLE.
''' ESP32 code

class MyCallbacks: public BLECharacteristicCallbacks {
    void onWrite(BLECharacteristic *pCharacteristic) {
      String receivedData = pCharacteristic->getValue().c_str();  
      Serial.print("Received data: ");
      Serial.println(receivedData);
      sendSerialToBLE("Received data: ");
      sendSerialToBLEln(receivedData);
    }
}
void sendSerialToBLE(String data) {
  if (deviceConnected) { // BLE 연결 상태 확인
    pCharacteristic->setValue(data.c_str()); // BLE 특성에 데이터 설정
    pCharacteristic->notify();              // BLE 데이터 송신
  }
}

void sendSerialToBLEln(String data) {
    if (deviceConnected) {
        data += "\n"; // 줄바꿈 추가
        pCharacteristic->setValue(data.c_str());
        pCharacteristic->notify();
    }
}

void setup(){
BLEDevice::init("ESP32_S3_BLE");
  BLEServer *pServer = BLEDevice::createServer();
  pServer->setCallbacks(new MyServerCallbacks());

  BLEService *pService = pServer->createService(SERVICE_UUID);
  pCharacteristic = pService->createCharacteristic(
                      CHARACTERISTIC_UUID,
                      BLECharacteristic::PROPERTY_READ |
                      BLECharacteristic::PROPERTY_WRITE |
                      BLECharacteristic::PROPERTY_NOTIFY
                    );
  pCharacteristic->setCallbacks(new MyCallbacks());               
  pCharacteristic->addDescriptor(new BLE2902());
  
  pCharacteristic->setValue("Hello from ESP32-S3!");

  pService->start();

  pServer->getAdvertising()->start();
  Serial.println("BLE advertising started...");
}

I used blocks 'when BLE.StringReceived' and 'set Textbox.Text to stringValues'
In the Textbox, there is no data changed

Dear @_188,
just by typing BLE into the search field you can find a huge amount of examples.

Or, post your .aia, also.

thank you so much. After this, I tried to solve myself for long time. Finally I found that I did a mistake!

Glad you solved !!!
Anything solved by yourself is worth double. :+1:

Anyway, the next time you need some help, please add both the .ino and the .aia files, otherwise it is difficult to help you.
Best wishes.