I'm working with the ncs 1.6.1 peripheral_uart example and am looking to increase the size of the data frame to send 240 bytes per data frame.
I have seen several threads regarding this, but have not seen the complete solution shown anywhere.
Could you post an example of main.c and prj.conf where the NUS data frame is 240 bytes?
There are no changes necessary in main.c, but you'll need to add the following configs to the prj.conf file:
The project must also be configured to set the BT_NUS_UART_BUFFER_SIZE to 240 and UART_0_NRF_TX_BUFFER_SIZE in your project's Kconfig file to 240. After that the peripheral_uart sample will be able to transmit 240 bytes at a time (I just tested it on my end). You should make sure that the central you use to connect to the device supports MTU sizes of up to 240 though.
That worked, thank you.
I could not get UART_0_NRF_TX_BUFFER_SIZE to update when adding it to the Kconfig file, so I just added the following line into the prj.conf file:
In main.c, would it be appropriate use bt_conn_le_data_len_update() to update the MTU to 240?