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
  • 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?

  • I am receiving the correct data. What I am asking is how do I change the events so that variable bytes can be the payload of the packet. I still receive all the correct data, but the waveform for the current shows 8 separate connection events to send 8 bytes. Is it possible to send 1 connection event with 8 byte data payload instead of requiring a new connection event with a new header and a new 1 byte payload? I want to see if there is a difference in current between a connection event header and footer with a payload of 1 byte vs a connection event header and footer with a payload of 8 bytes and so on.

  • 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;
    

    ??

Related