1) By default the GATT MTU Size is 23 bytes. So the size of the array you can send is also limited by this.
However, in order to increase this, you can set the MTU Size in PSoC Creator-> BLE Component -> GAP Settings -> MTU Size is kept to a high value. (Say 40, 60 or 100). Max value is 512. However the client and server should undergo negotiation about the increased MTU Size.
The client should always initiate the MTU increase request.
If your Cypress BLE Device is server, it will receive CYBLE_EVT_GATTS_XCNHG_MTU_REQ event once the client initiate the MTU request. It should now respond by CyBle_GattsExchangeMtuRsp.
If your Cypess BLE Deviceis client, it should initiate the MTU negotiation by calling CyBle_GattcExchangeMtuReq. Once the server has responded, the client would receive CYBLE_EVT_GATTC_XCHNG_MTU_RSP event. Please refer to BLE Datasheet for more details on these APIs and events.
2) You can refer the source code of our CySmart Android App to check how the notified value is read as array on the client. You can refer the capsesence RGB Led Custom Service.
- Madhu Sudhan
Hello Madhu, Thank you for your reply. I will look into the cysmart app on clues how to get an array out of a characteristic. On the part of sending an array, I was hoping to be able to send about 500 int16 values in one array. I assume 500 int16 values won't fit in a 20, or even 500 bit array? I read in an article about throughput, that the ble device should be able to put a datarate of about 200kb/s through. I'm not yet sure how this relates to a maximum characteristic size of about 500. Any explanation (or articles I should read) are welcome.
AFAIK when you have a characteristic with more than the MTU allows, the BLE stack should automatically do a 'long read'. This means its splitting up the transfer into multiple packets. I did this before with 244 bytes of data, and did not remember of any special this I needed to do.