ext/hal/nordic/drivers/nrf_drv_radio802154.c
// Set pending bit in ACK frame.
Set pending bit in ACK frame.
Set pending bit in ACK frame .
static inline void ack_pending_bit_set(void)
{
    uint8_t * p_src_addr;
    uint32_t  i;
    bool      found = false;
    m_ack_psdu[FRAME_PENDING_OFFSET] = ACK_HEADER_WITH_PENDING;
    if (!m_setting_pending_bit_enabled)
    {
        return;
    }
    switch (mp_current_rx_buffer->psdu[DEST_ADDR_TYPE_OFFSET] & DEST_ADDR_TYPE_MASK)
    {
    case DEST_ADDR_TYPE_SHORT:
        p_src_addr = &mp_current_rx_buffer->psdu[SRC_ADDR_OFFSET_SHORT_DST];
        break;
    case DEST_ADDR_TYPE_EXTENDED:
        p_src_addr = &mp_current_rx_buffer->psdu[SRC_ADDR_OFFSET_EXTENDED_DST];
        break;
    default:
        return;
    }
    if (0 == (mp_current_rx_buffer->psdu[PAN_ID_COMPR_OFFSET] & PAN_ID_COMPR_MASK))
    {
        p_src_addr += 2;
    }
    switch (mp_current_rx_buffer->psdu[SRC_ADDR_TYPE_OFFSET] & SRC_ADDR_TYPE_MASK)
    {
    case SRC_ADDR_TYPE_SHORT:
        for (i = 0; i < NUM_PENDING_SHORT_ADDRESSES; i++)
        {
            if (nrf_radio_state_get() != NRF_RADIO_STATE_TX_RU)
            {
                break;
            }
            if (0 == memcmp(p_src_addr, m_pending_short[i], sizeof(m_pending_short[i])))
            {
                found = true;
                break;
            }
        }
        break;
    case SRC_ADDR_TYPE_EXTENDED:
        for (i = 0; i < NUM_PENDING_EXTENDED_ADDRESSES; i++)
        {
            if (nrf_radio_state_get() != NRF_RADIO_STATE_TX_RU)
            {
                break;
            }
            if (0 == memcmp(p_src_addr, m_pending_extended[i], sizeof(m_pending_extended[i])))
            {
                found = true;
                break;
            }
        }
        break;
    default:
        return;
    }
    if (!found)
    {
        m_ack_psdu[FRAME_PENDING_OFFSET] = ACK_HEADER_WITHOUT_PENDING;
    }
}
static inline void ack_pending_bit_set ( void ) { uint8_t * p_src_addr ; uint32_t i ; bool found = false ; m_ack_psdu [ FRAME_PENDING_OFFSET ] = ACK_HEADER_WITH_PENDING ; if ( ! m_setting_pending_bit_enabled ) { return ; } switch ( mp_current_rx_buffer -> psdu [ DEST_ADDR_TYPE_OFFSET ] & DEST_ADDR_TYPE_MASK ) { case DEST_ADDR_TYPE_SHORT : p_src_addr = & mp_current_rx_buffer -> psdu [ SRC_ADDR_OFFSET_SHORT_DST ] ; break ; case DEST_ADDR_TYPE_EXTENDED : p_src_addr = & mp_current_rx_buffer -> psdu [ SRC_ADDR_OFFSET_EXTENDED_DST ] ; break ; default : return ; } if ( 0 == ( mp_current_rx_buffer -> psdu [ PAN_ID_COMPR_OFFSET ] & PAN_ID_COMPR_MASK ) ) { p_src_addr += 2 ; } switch ( mp_current_rx_buffer -> psdu [ SRC_ADDR_TYPE_OFFSET ] & SRC_ADDR_TYPE_MASK ) { case SRC_ADDR_TYPE_SHORT : for ( i = 0 ; i < NUM_PENDING_SHORT_ADDRESSES ; i ++ ) { if ( nrf_radio_state_get ( ) != NRF_RADIO_STATE_TX_RU ) { break ; } if ( 0 == memcmp ( p_src_addr , m_pending_short [ i ] , sizeof ( m_pending_short [ i ] ) ) ) { found = true ; break ; } } break ; case SRC_ADDR_TYPE_EXTENDED : for ( i = 0 ; i < NUM_PENDING_EXTENDED_ADDRESSES ; i ++ ) { if ( nrf_radio_state_get ( ) != NRF_RADIO_STATE_TX_RU ) { break ; } if ( 0 == memcmp ( p_src_addr , m_pending_extended [ i ] , sizeof ( m_pending_extended [ i ] ) ) ) { found = true ; break ; } } break ; default : return ; } if ( ! found ) { m_ack_psdu [ FRAME_PENDING_OFFSET ] = ACK_HEADER_WITHOUT_PENDING ; } }
Set pending bit in ACK frame.
Set pending bit in ACK frame .