/* Function for transferring a byte when it collides with SLIP commands and follows the SLIP escape byte, that is 0xC0 => 0xDC and 0xDB => 0xDD.  */
static uint32_t send_tx_byte_encoded(void)
/* Function for transferring a byte when it collides with SLIP commands and follows the SLIP escape byte, that is 0xC0 => 0xDC and 0xDB => 0xDD.  */
static uint32_t send_tx_byte_encoded(void)
{
    uint32_t err_code;
    switch(mp_tx_buffer[m_tx_buffer_index])
    {
        case APP_SLIP_END:
            err_code = app_uart_put(APP_SLIP_ESC_END);
            break;
        case APP_SLIP_ESC:
            err_code = app_uart_put(APP_SLIP_ESC_ESC);
            break;
        default:
            err_code = NRF_ERROR_NO_MEM;
            break;
    }
    if (err_code == NRF_SUCCESS)
    {
        m_tx_buffer_index++;
        send_tx_byte = send_tx_byte_default;
    }
    return err_code;
}