ext/hal/nordic/drivers/nrf_drv_radio802154.c
// Check if received destination address matches local or broadcast address.
Check if received destination address matches local or broadcast address.
Check if received destination address matches local or broadcast address .
static inline bool received_dest_addr_matched(void)
{
    if ((0 != memcmp(&mp_current_rx_buffer->psdu[PAN_ID_OFFSET + 1], m_pan_id, PAN_ID_SIZE)) &&
        (0 != memcmp(&mp_current_rx_buffer->psdu[PAN_ID_OFFSET + 1], BROADCAST_ADDRESS, PAN_ID_SIZE)))
    {
        return false;
    }
    switch (mp_current_rx_buffer->psdu[DEST_ADDR_TYPE_OFFSET] & DEST_ADDR_TYPE_MASK)
    {
    case DEST_ADDR_TYPE_SHORT:
    {
        if ((0 != memcmp(&mp_current_rx_buffer->psdu[DEST_ADDR_OFFSET + 1], m_short_addr, SHORT_ADDRESS_SIZE)) &&
            (0 != memcmp(&mp_current_rx_buffer->psdu[DEST_ADDR_OFFSET + 1], BROADCAST_ADDRESS, SHORT_ADDRESS_SIZE)))
        {
            return false;
        }
        break;
    }
    case DEST_ADDR_TYPE_EXTENDED:
    {
        if (0 != memcmp(&mp_current_rx_buffer->psdu[DEST_ADDR_OFFSET + 1], m_extended_addr, sizeof(m_extended_addr)))
        {
            return false;
        }
        break;
    }
    default:
        return false;
    }
    return true;
}
static inline bool received_dest_addr_matched ( void ) { if ( ( 0 != memcmp ( & mp_current_rx_buffer -> psdu [ PAN_ID_OFFSET + 1 ] , m_pan_id , PAN_ID_SIZE ) ) && ( 0 != memcmp ( & mp_current_rx_buffer -> psdu [ PAN_ID_OFFSET + 1 ] , BROADCAST_ADDRESS , PAN_ID_SIZE ) ) ) { return false ; } switch ( mp_current_rx_buffer -> psdu [ DEST_ADDR_TYPE_OFFSET ] & DEST_ADDR_TYPE_MASK ) { case DEST_ADDR_TYPE_SHORT : { if ( ( 0 != memcmp ( & mp_current_rx_buffer -> psdu [ DEST_ADDR_OFFSET + 1 ] , m_short_addr , SHORT_ADDRESS_SIZE ) ) && ( 0 != memcmp ( & mp_current_rx_buffer -> psdu [ DEST_ADDR_OFFSET + 1 ] , BROADCAST_ADDRESS , SHORT_ADDRESS_SIZE ) ) ) { return false ; } break ; } case DEST_ADDR_TYPE_EXTENDED : { if ( 0 != memcmp ( & mp_current_rx_buffer -> psdu [ DEST_ADDR_OFFSET + 1 ] , m_extended_addr , sizeof ( m_extended_addr ) ) ) { return false ; } break ; } default : return false ; } return true ; }
Check if received destination address matches local or broadcast address.
Check if received destination address matches local or broadcast address .
// Check destination PAN Id. // Note that +1 in PSDU offset is added because first byte in PSDU is length. // Check destination address. // Note that +1 in PSDU offset is added because first byte in PSDU is length. // Note that +1 in PSDU offset is added because first byte in PSDU is length.