I've initiated a BLE connection, in onServicesDiscovered
I'm going to read out all descriptors. There are five of them and I proceed with this:
for (int n=0;n<descriptors.size();n++)
{
gatt.readDescriptor(descriptors.get(n));
}
descriptors contains all descriptors... Then the read callback is called and I'm going to read out the descriptors value:
@Override
public void onDescriptorRead(BluetoothGatt gatt, final BluetoothGattDescriptor descriptor, int status)
{
deviceInfoArray.add(new ItemSlideMenu(new String(descriptor.getValue()));
}
The problem is, that the read callback is only called once, instead of five times. Can you tell me why and how to fix this?