nRF52832 Bluetooth peripheral_uart sample: use RX data and not sent to BLE

I want to intercept some data in the RX (in section UART_RX_READY in uart_cb() as a command with arguments.  And I do not want this data to be sent on the the BLE.

After I get the data that I want, what should I do with the buf, so the process continues getting new data from the UART RX?

Do I just k_free(buf)?  Or something else?

Parents Reply
  • I moved by command handling code to the UART_RX_BUF_RELEASED section.  At the end I set buf->len = 0, so the buf will be freed, k_free(buf).  But something still seems to be around because I get the following when I switch back to "data mode" and connect to a tablet running nRF Connect:

    RING:CONNECTED
    [00:10:15.156,921] <inf> peripheral_uart: Connected 43:76:74:54:A2:83 (random)
    [00:11:36.653,747] <wrn> bt_att: No ATT channel for MTU 39
    [00:11:36.653,778] <wrn> bt_gatt: No buffer available to send notification
    [00:11:36.653,869] <wrn> peripheral_uart: Failed to send data over BLE connection

Children
Related