/* Function for handling the UART module event. It parses events from the UART when bytes are received/transmitted.  */
static void slip_uart_eventhandler(app_uart_evt_t *uart_event)
/* Function for handling the UART module event. It parses events from the UART when bytes are received/transmitted.  */
static void slip_uart_eventhandler(app_uart_evt_t *uart_event)
{
    if (uart_event->evt_type == APP_UART_TX_EMPTY && m_current_state == SLIP_TRANSMITTING)
    {
        transmit_buffer();
    }
    if ((uart_event->evt_type == APP_UART_DATA) && (!rx_buffer_overflowed()))
    {
        handle_rx_byte(uart_event->data.value);
    }
}