pub unsafe extern "C" fn uart_pattern_get_pos(
    uart_num: uart_port_t
) -> c_int
Expand description

@brief Return the nearest detected pattern position in buffer. The positions of the detected pattern are saved in a queue, This function do nothing to the queue. @note If the RX buffer is full and flow control is not enabled, the detected pattern may not be found in the rx buffer due to overflow.

   The following APIs will modify the pattern position info:
   uart_flush_input, uart_read_bytes, uart_driver_delete, uart_pop_pattern_pos
   It is the application's responsibility to ensure atomic access to the pattern queue and the rx data buffer
   when using pattern detect feature.

@param uart_num UART port number, the max port number is (UART_NUM_MAX -1). @return - (-1) No pattern found for current index or parameter error - others the pattern position in rx buffer.