How can I count the number of packets sent and received in the bt_gatt_write() operation?

I have an application where I use the bt_gatt_write() method and I would like to obtain information about the number of packets sent in my operations.

I would like to know how many packets it sent, and if it needed to send more than once to receive confirmation of receipt from the other end.

I would also like to obtain the PRR (Packet Reception Rate) on the node that receives the write.

  • Hi,

    This sounds a bit like it could be a XY Problem.
    Can you explain the issue you are trying to fix by counting packets?

    Regards,
    Sigurd Hellesvik

  • Hi Sigurd Hellesvik, I'll share my problem with more details.

    1)
    I'm believed that in environments with many noises or if the central and peripheral stay between a big distance, there possible there lost information. But as the bt_gatt_write() send information until receiving the confirmation from peripheral, in this scenario, the central can need send many times to have certainty that peripheral receiving the message.
    I would like measure the rate of send and received to define the quality of communication. I could measure the rate of loss rate or reception rate.

    2)
    When establishes the communication with data length 27Bytes (4.0) but I send 30Bytes, this information need break in 2 parts. I would like count this number of package the technology needed to send. Same situation if have data length 251Bytes and I send 300Bytes.

    Purpose
    I created the application from example UART service provided by nordic, to assess the different scenarios and environment the communication. Now I would like to find the parameters cited in 1 and 2.

    Thanks

  • We do provide the Bluetooth Low Energy nRF Sniffer for Bluetooth LE. With this you can inspect Bluetooth traffic live on the air.

    It sounds to me like your use-case do not need to be done all the time, but for to inspect communication once and then make some choices, right?
    In this case, can I suggest the sniffer?

Related