I know there are multiple different questions/answers relating to this topic but none exactly solved my issue. Further, some of the questions are many years old so it's not clear to me if some of that information is perfectly relevant. So here goes...
I am trying to create a characteristic that is up to 512 bytes which I believe I read is a BLE maximum.
During the setup of the characteristic I set the following variables:
attr_char_value.max_len = VECTOR_DATA_SIZE;
attr_char_value.init_len = VECTOR_DATA_SIZE;
Where VECTOR_DATA_SIZE is programmable. As an experiment I set it to 64 (decimal).
I then initialize the value in the peripheral characteristic to 0,1,2,3,...63
So far so good.
If I then open up nRF Connect and attempt to READ this characteristic I see that the size of the characteristic is correct and the proper data is returned.
If I try to WRITE that data however, I get a BLE_GATT_STATUS_ATTERR_APP_BEGIN error.
As you might expect, I see this same error if the size (ie: VECTOR_DATA_SIZE) is set to any value greater than 20.
What am I missing?