This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Queued Writes characteristic value longer than 220B

Hello.

I neet to write long characteristic value (250B). I use GATTS Queued Writes from example devzone.nordicsemi.com/.../ based on developer.nordicsemi.com/.../a00892.html I send data from nRF Master Control Panel (Android 4.4, Nexus 4) and watch on-air communication witch sniffer, code is written for nRF51822 XAA, SoftDevice S110 version 7.1.

I is almost work: when I send up to 220 bytes value I see on snifer sequence of Prepare Write Request and Prepare Write Respons with consecutive offests, and at the end there is Execute Write Request, and characteristic is written. BUT, when I want send longer value (eg 221 bytes long) after sequence of Prepare Write Request/Response there is Prepare Queue Full and write is canceled.

How long is this queue in Queued Write? Is this configurable? Is there a different method to write characteristic value longer than 220B.

Parents
  • Hi

    Piko, the best way to determine how much space you should provide when you receive BLE_EVT_USER_MEM_REQUEST is the following calculation.

    H = handle (2 byte) + offset (2 byte) + length (2 byte) = 6
    MTU = 23
    DATA = MTU-H = 17
    
    Total Memory = ceil(Char Max Len*MTU/DATA) + 2
    
Reply
  • Hi

    Piko, the best way to determine how much space you should provide when you receive BLE_EVT_USER_MEM_REQUEST is the following calculation.

    H = handle (2 byte) + offset (2 byte) + length (2 byte) = 6
    MTU = 23
    DATA = MTU-H = 17
    
    Total Memory = ceil(Char Max Len*MTU/DATA) + 2
    
Children
Related