This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Long Read write string and Image data

Hi,

I am Using nRF5_SDK_15.0.0 with nRF52 DK PCA10040 using Keil IDE.

I am going to Implement long string data write and read characteristic using custom service.

I would like to know best way to Implement long write and read.

what is maximum length of data I can transfer in one chunk (packet)? is there any example code available?

I see some queue operation in code. is it similar to long write and read? if yes, please let me know how to use queue operation.

As of now I am dividing large data into number of packets with 20 bytes in each packet and transferring one by one. At central side receiving one by one and assemble it. 

Thanks.

Parents Reply
  • Sorry, my bad. Here's an excerpt: 

    "Limits for queued write (also named "long write") and read long wrt. to size is depending on host and client implementations. What will happen here is that you will never know the actual size of the request, as you will get chunks of ATT_MTU-1 size until one of the sides either completes the transaction or you NACK the request (ie: received size has exceeded the buffer size).

     

    Technically, the max. size that you can have up to 64K given that the offset field is 16 bit, however; this will be limited by the amount of memory that you, as the developer, provide to the softdevice at the time of initiating a long write (given in event "BLE_EVT_USER_MEM_REQUEST").

     

    For a read long characteristic, this is stack handled and will depend on what you provide to the ATTDB size (configurable in both S110 and S13x).

      

    From page 1921 in Core_v4.0:

    4.8.3 Read Long Characteristic Values

    This sub-procedure is used to read a Characteristic Value from a server when the client knows the Characteristic Value Handle and the length of the CharacteristicValue is longer than can be sent in a single Read Response AttributeProtocol message.

     

    Figure 4.10 shows how the transaction goes over-air."


    I do not think there's a queued read equivalent as it is up to the server to decided if it supports queued writes or not. If it does and can make use of queued writes, then the server should always do so without being explicitly asked to by the client. 

Children
No Data
Related