This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

There are a way to clean queued data on tx buffer?

Hi everyone,

I am using nrfConnect 3.9.3, And SDK v1.7.0.

I am working on a project based on uart example.

My question is if there are some way for clean/discard all the data that a peer have buffered on nus tx characteristic through bt_nus_send().

The main reason is that i want to send only one packet per connection with the less delay possible, for that I turn on the Radio Notifications with MPSL_RADIO_NOTIFICATION_DISTANCE_5500US, and when is triggered i refresh the packet with the data of my sensors.

On add if there are some way to make longer this time MPSL_RADIO_NOTIFICATION_DISTANCE_5500US could be great.

Thank you Nordic Team,

regards

Parents
  • Hi another time, I was trying to find a function to clean (&att->tx_queue), due to  this buffer is filled when bt_nus_send() -> gatt_notify() -> bt_att_send()

    On the last function is filled the buffer with the function

    net_buf_put(&att->tx_queue, buf);

    So makes sense that att_reset() clean all the att->tx_queue

    static void att_reset(struct bt_att *att)
    {
    	struct bt_att_req *req, *tmp;
    	struct net_buf *buf;
    
    #if CONFIG_BT_ATT_PREPARE_COUNT > 0
    	/* Discard queued buffers */
    	while ((buf = net_buf_get(&att->prep_queue, K_NO_WAIT))) {
    		net_buf_unref(buf);
    	}
    #endif /* CONFIG_BT_ATT_PREPARE_COUNT > 0 */
    
    	while ((buf = net_buf_get(&att->tx_queue, K_NO_WAIT))) {
    		net_buf_unref(buf);
    	}
    
    	att->conn = NULL;
    
    	/* Notify pending requests */
    	SYS_SLIST_FOR_EACH_CONTAINER_SAFE(&att->reqs, req, tmp, node) {
    		if (req->func) {
    			req->func(NULL, BT_ATT_ERR_UNLIKELY, NULL, 0,
    				  req->user_data);
    		}
    
    		bt_att_req_free(req);
    	}
    
    	k_mem_slab_free(&att_slab, (void **)&att);
    }

    Unfortunatelly isn't work, data queued keeps beeing sended.

    My question is if there are some way for clean/discard all the data that a peer have buffered on nus tx characteristic through bt_nus_send().

    Any suggestion is welcome, i think that what i am asking mustn't be an impossibble thing, no?

    Thank you

  • Hi Daniel,

    Kindly take a look at the MPSL RADIO NOTIFICATION DISTANCES. Hope this helps. Slight smile

    Regards,

    Priyanka

  • Hi, sorry but I have implemented the radio notification distances callback already. What I need is a way to clean the data queued on ble tx buffer as i explained on my first post

    My question is if there are some way for clean/discard all the data that a peer have buffered on nus tx characteristic through bt_nus_send().

    Thank you PriyankaSmiley

  • Hi another tiime,

    my question is same as:

    https://devzone.nordicsemi.com/f/nordic-q-a/37627/reset-clear-hvn-tx-queue

    But on the SDK 1.7.0 on a nrf52840 with softdevice s140.

    Thank you

  • As I know data is queued until data is sent or there is a disconnection.

    There isn't a way to trigger the same function as a disconnection trigger to clean the ble tx buffer on softdevice?

    Thank you

  • Hi Daniel,

    I am afraid there is no way to achieve this. Once the data is uploaded in the stack it stays there until it is transmitted or disconnected.

    Regards,

    Priyanka

Reply Children
No Data
Related