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

How do I minimize the number of connection messages sent?

I'm looking at a BLE application using the nRF51822 where we need to send data maybe once every 10 minutes, so it seems like disconnecting in between sending messages will save a lot of battery life. However, each time a connection is made, in between advertising and the actual data transfer, there are a whole bunch of L2CAP messages being sent at about 25 ms intervals.

I haven't yet worked out exactly what they're for, but it seems like they're to do with negotiating the connection parameters and/or synchronizing between the devices. Many of them have the data type L2CAP-C, with no actual data being sent, and some of them contain link layer commands.

I assume they are unavoidable, but what can I do to minimize the number of messages being sent? Failing that, what exactly are they, and what are they for?

Thanks in advance!

Parents
  • Hi Rory,

    I assume they are unavoidable, but what can I do to minimize the number of messages being sent? Failing that, what exactly are they, and what are they for?

    From what you say those sound like connection parameter updates. Ole Morten suggests they could be related to security, but those wouldn't be labeled as L2CAP-C, so I am leaning towards your implementation requesting a connection parameter update every time it connects to the central. This is by the way completely avoidable, and so you could reconnect every 10min without having to exchange those packets and change the connection parameters.

    If we are indeed talking about a connection parameter update, you should see something like this:

    Peripheral -> L2CAP Conn Param Update Request -> Central Peripheral <- L2CAP Conn Param Update Response <- Central

    Can you share your traces?

    Carles

Reply
  • Hi Rory,

    I assume they are unavoidable, but what can I do to minimize the number of messages being sent? Failing that, what exactly are they, and what are they for?

    From what you say those sound like connection parameter updates. Ole Morten suggests they could be related to security, but those wouldn't be labeled as L2CAP-C, so I am leaning towards your implementation requesting a connection parameter update every time it connects to the central. This is by the way completely avoidable, and so you could reconnect every 10min without having to exchange those packets and change the connection parameters.

    If we are indeed talking about a connection parameter update, you should see something like this:

    Peripheral -> L2CAP Conn Param Update Request -> Central Peripheral <- L2CAP Conn Param Update Response <- Central

    Can you share your traces?

    Carles

Children
No Data
Related