How to send 25 packets of data each second

I am not able to send 25 array packets each second. array size is 244 bytes

I am reading the sensor data continuosly and every 40 ms i am sending the data to bluetooth using gatt_notify

Each second the receiver receiving different number of packets 

1st second 24 packets
2nd second 25 packets 
3rd second 23 packets like wise Receiver receiving the data 

every second 25 packets are not receiving 


Please help on this 

Thank you in advance

Parents Reply
  • Hi 

    It's true that the L2CAP_TX_MTU is not limited to 251 bytes, but the data length is:

    config BT_CTLR_DATA_LENGTH_MAX
    	int "Maximum data length supported"
    	depends on BT_CTLR_DATA_LENGTH
    	default BT_BUF_ACL_RX_SIZE if BT_BUF_ACL_RX_SIZE < 251
    	default 27
    	range 27 BT_BUF_ACL_RX_SIZE if BT_BUF_ACL_RX_SIZE < 251
    	range 27 251
    	help
    	  Set the maximum data length of PDU supported in the Controller.

    Once you send packets longer than this they will have to be segmented by the link layer, and the throughput will suffer as a result. The ideal situation is to negotiate a 251 byte data length, and send data packets of 244 bytes (leaving 7 bytes for the L2CAP and ATT headers). 

    I am reading the sensor data continuosly and every 40 ms i am sending the data to bluetooth using gatt_notify

    Rather than sending the packets every 40ms I would recommend sending them as fast as possible, then you will be able to more efficiently fill the buffers in the Bluetooth stack, which will increase overall throughput. 

    Best regards
    Torbjørn

Children
No Data
Related