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

Return error(-120) when send huge data in NCS NUS poject

Hi

My purpose:

Send 180 Bytes per 10 millisecond

I got a problem:

I use NUS project in NCS SDK15.0,when I send data per 10 ms,It return"Failed to send data over BLE connection(err -120)", and  I find that the data send success per 20ms(instead of 10ms) when I use a Sniffer

My try:

When I use throughput project ,It's OK,that one of all diffrence is throughput use bt_gatt_write_without_response while NUS use notify

My question

1.Could you please tell me  what the "-120"mean? I have not find the -120 define in error.h

2.whether send with Respose or not is the reason send fail?

Best regards

Victor

Parents
  • Hi Victor,

    There should not be much difference between the handling of a write without response packet and a notification. Have you tried to increase the various buffer lengths in your prj.conf file for the bluetooth_uart sample to the same as we use in the throughput sample? This should allow you to queue up more packets and also avoid having to split the 180 byte payload across multiple packets.

    CONFIG_BT_RX_BUF_LEN=255
    CONFIG_BT_L2CAP_TX_MTU=247
    CONFIG_BT_L2CAP_RX_MTU=247
    CONFIG_BT_CTLR_RX_BUFFERS=2
    CONFIG_BT_CTLR_TX_BUFFERS=10
    CONFIG_BT_CTLR_TX_BUFFER_SIZE=251
    CONFIG_BT_CTLR_DATA_LENGTH_MAX=251

    Best regards,

    Vidar

Reply
  • Hi Victor,

    There should not be much difference between the handling of a write without response packet and a notification. Have you tried to increase the various buffer lengths in your prj.conf file for the bluetooth_uart sample to the same as we use in the throughput sample? This should allow you to queue up more packets and also avoid having to split the 180 byte payload across multiple packets.

    CONFIG_BT_RX_BUF_LEN=255
    CONFIG_BT_L2CAP_TX_MTU=247
    CONFIG_BT_L2CAP_RX_MTU=247
    CONFIG_BT_CTLR_RX_BUFFERS=2
    CONFIG_BT_CTLR_TX_BUFFERS=10
    CONFIG_BT_CTLR_TX_BUFFER_SIZE=251
    CONFIG_BT_CTLR_DATA_LENGTH_MAX=251

    Best regards,

    Vidar

Children
No Data
Related