Hi,
I'm running the sample "peripheral_uart" on an nRF52dk. It has a config called CONFIG_BT_NUS_UART_RX_WAIT_TIME, which is set to 50. The comment says the unit is milliseconds. That value is sent into function uart_rx_enable(). When I read about that function (docs.zephyrproject.org/.../uart.html, it is said that the unit is microseconds. Which is correct?
What is the behaviour if two bytes are sent on UART to the DK right after each other? That is, the first bit of the second byte comes immediately after the first byte is finished. If communicating at 115200 it takes about 70 microseconds for a byte to be transmitted. If having the timeout set to 50 (supposing the unit is microseconds), will the timer expire before the byte is completed? Or how does the timer work?
What is a good value to have on the timer if communicating at 115200?
The sample handles long UART messages by splitting them into several 40-byte parts before they are supposed to be sent on BLE. But if a message is more than 21 bytes, I get the following warnings (in this case the UART message was 22 bytes):
<wrn> bt_att: No ATT channel for MTU 24
<wrn> bt_gatt: No buffer available to send notification
<wrn> peripheral_uart: Failed to send data over BLE connection
There is a maximum of 23 bytes (CONFIG_BT_L2CAP_TX_MTU) for notifcations. Is it meant that each programmer should solve this? If splitting, for instance, the UART-data into 20-byte parts instead of 40 bytes, it works fine.
Best regards,
Lars