/* Callback for notifying upper layer that either a packet was succesfully received or it was dropped.  */
static __INLINE void callback_packet_received(void)
/* Callback for notifying upper layer that either a packet was succesfully received or it was dropped.  */
static __INLINE void callback_packet_received(void)
{
    if (mp_rx_stream == m_rx_drop_buf)
    {
        m_ser_phy_rx_event.evt_type = SER_PHY_EVT_RX_PKT_DROPPED;
    }
    else
    {
        m_ser_phy_rx_event.evt_type = SER_PHY_EVT_RX_PKT_RECEIVED;
        m_ser_phy_rx_event.evt_params.rx_pkt_received.num_of_bytes =
            m_rx_stream_index - SER_PHY_HEADER_SIZE;
        m_ser_phy_rx_event.evt_params.rx_pkt_received.p_buffer =
            mp_rx_stream;
    }
    mp_rx_stream       = NULL;
    m_rx_stream_length = 0;
    m_rx_stream_index  = 0;
    callback_ser_phy_event(m_ser_phy_rx_event);
}