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

Write to variable length characteristic

Hello,

I have some code running that transfers binary data from an iPhone to a nRF51822 device (used for firmware upgrade).

I have used a variable length characteristic with a maximum length of 20 bytes. I then write "as often as possible" from an iOS application using CBCharacteristicWriteWithoutResponse to avoid having to wait for data before sending the next packet.

This is working ok on iPhone 4S, but on newer models the connection interval seems to be longer which means I need a long delay between each packet causing the transfer speed to drop significately.

I'm now trying to send bigger packets. I started by reconfiguring my characteristic to allow bigger writes (knowing that these would still be divided into the MTU size) and allowing write (with response).


    char_md.char_props.write_wo_resp = 1;
    char_md.char_props.write = 1;

    attr_md.vloc = BLE_GATTS_VLOC_USER;
    attr_md.vlen = 1;

    attr_char_value.init_len     = 1;
    attr_char_value.init_offs    = 0;
    attr_char_value.max_len      = 512;
    attr_char_value.p_value      = m_stream_buffer;

The problem is that iOS gets an error message when I try to write more than 20 bytes of data (using a CBCharacteristicWriteWithResponse).

Has anyone else tried this?

Parents
  • Hi Ole,

    Thanks for your quick response! I was confused because you had referenced a link on how to implement long writes at the application, while (based on other posts) I was under the impression S110 v6.0.0 supported this through some higher-level API mechanism. I will look into this more as needed and post in a separate thread if I have any problems.

    Thanks again, Paarvai

Reply
  • Hi Ole,

    Thanks for your quick response! I was confused because you had referenced a link on how to implement long writes at the application, while (based on other posts) I was under the impression S110 v6.0.0 supported this through some higher-level API mechanism. I will look into this more as needed and post in a separate thread if I have any problems.

    Thanks again, Paarvai

Children
No Data
Related