Line data Source code
1 : // Copyright 2024 Accenture. 2 : 3 : #include "can/filter/AbstractStaticBitFieldFilter.h" 4 : 5 : namespace can 6 : { 7 : // virtual 8 3 : bool AbstractStaticBitFieldFilter::match(uint32_t const filterId) const 9 : { 10 3 : if (filterId <= MAX_ID) 11 : { 12 2 : uint16_t const idx = static_cast<uint16_t>(filterId / 8U); 13 : 14 2 : uint16_t const maskIndex = static_cast<uint16_t>(1U) << (filterId % 8U); 15 2 : return (static_cast<uint16_t>(getMaskValue(idx)) & maskIndex) == maskIndex; 16 : } 17 : return false; 18 : } 19 : 20 : } // namespace can