Descriptor is empty in android logs, and only 5 characteristics are shown but i have defined 6

I have made a simple arduino code in ESP 32, where there are 6 characteristics, I have made a flutter apk where I observe all the characteristics which I defined in the arduino.

I have tested with defining 10 characteristics, still only 5 of them are visible in my fluter apk, also i have tested with LightBlue application, in that application also only 5 characteristics are shown.

In setup code of arudino ->

        // Create the BLE Service
      BLEService* pService = pServer->createService(SERVICE_UUID);
    
      // Create a BLE Characteristic
      pCharacteristic1 = pService->createCharacteristic(
        CHARACTERISTIC_UUID1,
        BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_NOTIFY | BLECharacteristic::PROPERTY_INDICATE);
    
      // Create a BLE Descriptor
      pCharacteristic1->addDescriptor(new BLE2902());
    
    
      // Create a BLE Characteristic
      pCharacteristic2 = pService->createCharacteristic(
        CHARACTERISTIC_UUID2,
        BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_NOTIFY | BLECharacteristic::PROPERTY_INDICATE);
    
      // Create a BLE Descriptor
      pCharacteristic2->addDescriptor(new BLE2902());
    
    
      // Create a BLE Characteristic
      pCharacteristic3 = pService->createCharacteristic(
        CHARACTERISTIC_UUID3,
        BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_NOTIFY | BLECharacteristic::PROPERTY_INDICATE);
    
      // Create a BLE Descriptor
      pCharacteristic3->addDescriptor(new BLE2902());
    
      // Create a BLE Characteristic
      pCharacteristic4 = pService->createCharacteristic(
        CHARACTERISTIC_UUID4,
        BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_NOTIFY | BLECharacteristic::PROPERTY_INDICATE);
    
      // Create a BLE Descriptor
      pCharacteristic4->addDescriptor(new BLE2902());
    
      // Create a BLE Characteristic
      pCharacteristic5 = pService->createCharacteristic(
        CHARACTERISTIC_UUID5,
        BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_NOTIFY | BLECharacteristic::PROPERTY_INDICATE);
    
      // Create a BLE Descriptor
      pCharacteristic5->addDescriptor(new BLE2902());
    
    
      // Create a BLE Characteristic
      pCharacteristic6 = pService->createCharacteristic(
        CHARACTERISTIC_UUID6,
        BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE | BLECharacteristic::PROPERTY_NOTIFY | BLECharacteristic::PROPERTY_INDICATE);
    
      // Create a BLE Descriptor
      pCharacteristic6->addDescriptor(new BLE2902());

And in loop of arudino->

    // notify changed value
      if (deviceConnected) {
        pCharacteristic1->setValue((uint8_t*)&value, 4);
        pCharacteristic1->notify();
        
        pCharacteristic2->setValue((uint8_t*)&value, 4);
        pCharacteristic2->notify();
        
        pCharacteristic3->setValue((uint8_t*)&value, 4);
        pCharacteristic3->notify();
        
        pCharacteristic4->setValue((uint8_t*)&value, 4);
        pCharacteristic4->notify();
        
        pCharacteristic5->setValue((uint8_t*)&value, 4);
        pCharacteristic5->notify();
        
        pCharacteristic6->setValue((uint8_t*)&value, 4);
        pCharacteristic6->notify();
        value++;
        digitalWrite(2, HIGH);
        delay(1000);  // bluetooth stack will go into congestion, if too many packets are sent, in 6 hours test i was able to go as low as 3ms
      } else {
    
        digitalWrite(2, HIGH);  // Turn the LED on (HIGH is the voltage level)
        delay(2000);            // Wait for a second
        digitalWrite(2, LOW);   // Turn the LED off by making the voltage LOW
        delay(1000);
        }

Now in android logs i can find only 4 descriptor values, the characteristics 5 have empty descriptor and characteristics 6 was never found in the characteristics list

This is the log in android studio->

BluetoothCharacteristic{uuid: beb54831-36e1-4688-b7f5-ea07361b26a8, deviceId: C0:49:EF:CE:E7:E2, serviceUuid: 4fafc201-1fb5-459e-8fcc-c5c9c331914b, secondaryServiceUuid: null, properties: CharacteristicProperties{broadcast: false, read: true, writeWithoutResponse: false, write: true, notify: true, indicate: true, authenticatedSignedWrites: false, extendedProperties: false, notifyEncryptionRequired: false, indicateEncryptionRequired: false}, descriptors: [BluetoothDescriptor{uuid: 00002902-0000-1000-8000-00805f9b34fb, deviceId: C0:49:EF:CE:E7:E2, serviceUuid: 4fafc201-1fb5-459e-8fcc-c5c9c331914b, characteristicUuid: beb54831-36e1-4688-b7f5-ea07361b26a8, value: []}], value: []}

BluetoothCharacteristic{uuid: beb54832-36e1-4688-b7f5-ea07361b26a8, deviceId: C0:49:EF:CE:E7:E2, serviceUuid: 4fafc201-1fb5-459e-8fcc-c5c9c331914b, secondaryServiceUuid: null, properties: CharacteristicProperties{broadcast: false, read: true, writeWithoutResponse: false, write: true, notify: true, indicate: true, authenticatedSignedWrites: false, extendedProperties: false, notifyEncryptionRequired: false, indicateEncryptionRequired: false}, descriptors: [BluetoothDescriptor{uuid: 00002902-0000-1000-8000-00805f9b34fb, deviceId: C0:49:EF:CE:E7:E2, serviceUuid: 4fafc201-1fb5-459e-8fcc-c5c9c331914b, characteristicUuid: beb54832-36e1-4688-b7f5-ea07361b26a8, value: []}], value: []}

BluetoothCharacteristic{uuid: beb54833-36e1-4688-b7f5-ea07361b26a8, deviceId: C0:49:EF:CE:E7:E2, serviceUuid: 4fafc201-1fb5-459e-8fcc-c5c9c331914b, secondaryServiceUuid: null, properties: CharacteristicProperties{broadcast: false, read: true, writeWithoutResponse: false, write: true, notify: true, indicate: true, authenticatedSignedWrites: false, extendedProperties: false, notifyEncryptionRequired: false, indicateEncryptionRequired: false}, descriptors: [BluetoothDescriptor{uuid: 00002902-0000-1000-8000-00805f9b34fb, deviceId: C0:49:EF:CE:E7:E2, serviceUuid: 4fafc201-1fb5-459e-8fcc-c5c9c331914b, characteristicUuid: beb54833-36e1-4688-b7f5-ea07361b26a8, value: []}], value: []}

BluetoothCharacteristic{uuid: beb54834-36e1-4688-b7f5-ea07361b26a8, deviceId: C0:49:EF:CE:E7:E2, serviceUuid: 4fafc201-1fb5-459e-8fcc-c5c9c331914b, secondaryServiceUuid: null, properties: CharacteristicProperties{broadcast: false, read: true, writeWithoutResponse: false, write: true, notify: true, indicate: true, authenticatedSignedWrites: false, extendedProperties: false, notifyEncryptionRequired: false, indicateEncryptionRequired: false}, descriptors: [BluetoothDescriptor{uuid: 00002902-0000-1000-8000-00805f9b34fb, deviceId: C0:49:EF:CE:E7:E2, serviceUuid: 4fafc201-1fb5-459e-8fcc-c5c9c331914b, characteristicUuid: beb54834-36e1-4688-b7f5-ea07361b26a8, value: []}], value: []}

But for beb54835, there is no descriptor and beb54836 was not found in the characteristics.

BluetoothCharacteristic{uuid: beb54835-36e1-4688-b7f5-ea07361b26a8, deviceId: C0:49:EF:CE:E7:E2, serviceUuid: 4fafc201-1fb5-459e-8fcc-c5c9c331914b, secondaryServiceUuid: null, properties: CharacteristicProperties{broadcast: false, read: true, writeWithoutResponse: false, write: true, notify: true, indicate: true, authenticatedSignedWrites: false, extendedProperties: false, notifyEncryptionRequired: false, indicateEncryptionRequired: false}, descriptors: [], value: []}

I moved your topic to an appropriate forum category @heroickunal.

In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.

This is an important part of responsible forum usage, as explained in the "How to get the best out of this forum" guide. The guide contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

1 Like

Found that editing the numHandles solved the issue, by default only 15 numHandles was allowed

pService = pServer->createService(BLEUUID(SERVICE_UUID), 100);  // 100 handles

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.