Using BLE "discoverDescriptors" returns error BLE_ERROR_INVALID_STATE

Indeed, something was not right!

You cannot process the next descriptor discovery until you process the CCCD write event.

As such you need to include the onDataWritten callback function

.gattClient().onDataWritten( -- your data written function -- );

Then and only then (as in within your data written function) do you proceed to the next characteristic. Without that it fails.

Well, there you go… that was a rather messy learning process.

So after all that I now understand why the GattClient() example is the way it is…

Hopefully this forum post helps others in the same boat.