Sniff UART traffic while shell is enabled

Hi,

I am hoping to send/receive binary data (a protocol) on the same UART that has logging/shell enabled. Is there a way to access the UART RX traffic that the shell gets? I would like to pass it on to a function of my own for processing.

Parents
  • Hi Terence,

    I am not sure what you want to do and what is the use case, and also if I fully understand the requirements/needs.

    Nonetheless:

    UART Exercise talks about accessing the uart tx and rx buffers.

    UART Echo sample demonstrates how to use the UART serial driver. It reads data from the console and echos back.

    UART Passthrough sample virtually connects two UART instances. It reads data from console and transmits to the other interface.

    Shell UART API might also be of interest to you

    /br,

    Naeem

  • Thank you. Basically, I want to do something like the following:

    void uart_rx(uint8_t *data, uint16_t length)
    {
      // In the Shell UART example, the shell is already churning over incoming bytes
      shell_rx_processing(data, length);
    
      // I want my own custom protocol engine to churn over the same incoming bytes
      // in parallel to the shell's processing
      my_custom_protocol_rx_processing(data, length);
    }


    Could you point me to where in the code I would need to add this additional processing?
Reply
  • Thank you. Basically, I want to do something like the following:

    void uart_rx(uint8_t *data, uint16_t length)
    {
      // In the Shell UART example, the shell is already churning over incoming bytes
      shell_rx_processing(data, length);
    
      // I want my own custom protocol engine to churn over the same incoming bytes
      // in parallel to the shell's processing
      my_custom_protocol_rx_processing(data, length);
    }


    Could you point me to where in the code I would need to add this additional processing?
Children
No Data
Related