Reputation: 1
So ive been working on this some kind of bug on my project. I only see write and notify on my nRF Connect when i connect it on my esp32 and its companion app through BLE.
As you can see in my code, it already had the read property. Assistance would be greatly appreciated Thanks in advance.
BLEDevice::init("ESP32-ContactDevice");
BLEServer *server = BLEDevice::createServer();
server->setCallbacks(new MyServerCallbacks());
// Force MTU to be higher than 20 bytes
BLEDevice::setMTU(517);
// Create BLE Service
BLEService *contactService = server->createService("myServiceUUID");
// Create BLE Characteristic
contactCharacteristic = contactService->createCharacteristic(
"myCharacteristicUUID",
BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_NOTIFY | BLECharacteristic::PROPERTY_READ
);
// Add descriptor for notifications
contactCharacteristic->addDescriptor(new BLE2902());
contactCharacteristic->setCallbacks(new ContactCallbacks());
// Start the service
contactService->start();
// Start advertising
BLEAdvertising *advertising = BLEDevice::getAdvertising();
advertising->addServiceUUID(contactService->getUUID());
advertising->setScanResponse(true);
advertising->setMinPreferred(0x06); // 7.5ms connection interval (fast connection)
advertising->setMinPreferred(0x12); // 18.75ms connection interval (better stability)
BLEDevice::startAdvertising();
Serial.println("✅ ESP32: BLE setup complete.");
Upvotes: -1
Views: 15