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

L2CAP sd_ble_l2cap_tx running out of buffer

FormerMember
FormerMember

Hi all, I am trying to send and receive generic data from the L2CAP layer. So, initially I am just trying to send data with sd_ble_l2cap_tx with S110. The code that I am using is attached. In it the timer handler is executed every second where the a L2CAP packet is to be transmitted, but not as the sniffer doesn't sniff any packets. The UART output through printf that I am getting is

Count:7 Count:7 Count:7 Count:7 Count:7 Count:7 Count:7 Count:7 Error of 3003 at 139 in src/main.c Error of 4 at 340 in src/SDK/app_timer.c Why is the count of the sd_ble_tx_buffer_count_get always 7, but on the 8th call of sd_ble_l2cap_tx, it complains that it has run out of buffers?

Also when two devices are communicating through the L2CAP layer, should one device have central soft device (S120) and the other peripheral (S110)?

Thanks a ton, Prithvi

main.c

Parents
  • Hi there,

    sd_ble_tx_buffer_count_get() always returns the total number of available TX buffers, not the free count. For L2CAP, just like for write command and notification, you should use the guidelines here:

    devzone.nordicsemi.com/.../a00844.html devzone.nordicsemi.com/.../a01061.html

    Regarding your other questions:

    1. Is this enough of initialization for l2cap packets to be transmitted from s110?

    Yes, you only need to register the CID before starting to send data

    1. Can this L2CAP communication be sniffed by the sniffer software?

    Yes, as long as you use the sniffer you should at least see the L2CAP packets with the CID you defined.

    1. Also when two devices are communicating through the L2CAP layer, should one device have central soft device (S120) and the other peripheral (S110)?

    The S120 does not support the L2CAP APIs, so you cannot use an S120 as a central. You will have to use another device of your choice. This will be addressed in future releases.

    Thanks,

    Carles

Reply
  • Hi there,

    sd_ble_tx_buffer_count_get() always returns the total number of available TX buffers, not the free count. For L2CAP, just like for write command and notification, you should use the guidelines here:

    devzone.nordicsemi.com/.../a00844.html devzone.nordicsemi.com/.../a01061.html

    Regarding your other questions:

    1. Is this enough of initialization for l2cap packets to be transmitted from s110?

    Yes, you only need to register the CID before starting to send data

    1. Can this L2CAP communication be sniffed by the sniffer software?

    Yes, as long as you use the sniffer you should at least see the L2CAP packets with the CID you defined.

    1. Also when two devices are communicating through the L2CAP layer, should one device have central soft device (S120) and the other peripheral (S110)?

    The S120 does not support the L2CAP APIs, so you cannot use an S120 as a central. You will have to use another device of your choice. This will be addressed in future releases.

    Thanks,

    Carles

Children
No Data
Related