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

nRF51-DK Connection Event Packet Length

How would I go about changing the connection event packet length?

I have an 8 byte characteristic setup with notifications enabled, but it still looks like it is transmitting just 1 byte packets by looking at the current waveform on the oscilloscope.

How can I increase the connection event or packet payload so I can measure current for different payload sizes?


Setup

  • nRF51-DK
  • S110 7.1.0
  • SDK 7.2.0 ble_app_template modified with custom service in Keil
Parents
  • Hi Robert

    The radio transmits BLE packets with 1Mbps. This means that transmitting 8 payload bytes should take 8*8=64 microseconds. If you can not see any difference when sending 1 byte and when sending 8 bytes, you may want to check if you have the correct settings for your notifying characteristic. Look at this thread to see what is needed.

    I think you need to look at the three following properties in the services_init function:

    attr.max_len   = 1;
    
    attr.init_len  = sizeof(multilink_peripheral_data);
    
    attr_md.vlen = 0;
    

    which define the maximum size for the characteristic, initial length, and if the characteristic should have variable length or not. When you have changed that, you should be able to send data larger than one byte.

    When you connect with a central device (e.g. Master Control Panel) how many bytes do you see transmitted to the notify characteristic?

  • Hi Robert

    I suspect that you are only receiving one byte per connection event because the above parameters are set to only send one byte per connection event. What happens if you put

    attr.max_len   = 8;
    
    attr.init_len  = 8;
    
    attr_md.vlen = 1;
    

    ??

Reply Children
No Data
Related