c programing logic for reading sensor over UART

I'm trying to read data from a sensor connected to an mcu over UART. When powered the sensor outputs continuously an ASCII capital “R”, followed by four ASCII character digits representing distance in millimeters, followed by a carriage return (ASCII 13). E.g. R9999CR

For the uart there are two read functions a blocking one and non-blocking:

Blocking

/**
 * UART character data read.
 *
 * Perform a single character read from the UART interface.
 * This is a blocking synchronous call.
 *
 * @param[in] uart UART index.
 * @param[out] data Data to read from UART. This must not be NULL.
 * @param[out] status UART specific status.
 *
 * @return Standard errno return type for QMSI.
 * @retval 0 on success.
 * @retval Negative @ref errno for possible error codes.
 */
int uart_read(const uart_t uart, uint8_t *const data,
         uart_status_t *const status);

Non_blocking

/**
 * UART character data read.
 *
 * Perform a single character read from the UART interface.
 * This is a non-blocking synchronous call.
 *
 * @param[in] uart UART index.
 * @param[out] data Character read. This must not be NULL.
 *
 * @return Standard errno return type for QMSI.
 * @retval 0 on success.
 * @retval Negative @ref errno for possible error codes.
 */
int uart_read_non_block(const uart_t uart, uint8_t *const data);

I was wondering if somebody could help me figure out a logic to get a reading e.g. 9999 as a variable called reading.

Should I use the blocking or non blocking function and how would I isolate the characters if the data is streaming in?

if (Serial.available()>4){
  if (Serial.read() == 'R'){
  char0 = Serial.read();
  char1 = Serial.read();
  char2 = Serial.read();
  char3 = Serial.read();
  }
}

Put the 4 variables however you want.

You can read Seril Input Basics - updated, specifically the part with the start- and endmarker.

The start marker will be the 'R' and the endmarker the CR.