Class FilteredCanInterface¶
Defined in File hi_can.hpp
Inheritance Relationships¶
Base Type¶
public hi_can::CanInterface(Class CanInterface)
Derived Types¶
public hi_can::RawCanInterface(Class RawCanInterface)public hi_can::SoftwareFilteredCanInterface(Class SoftwareFilteredCanInterface)public hi_can::TwaiInterface(Class TwaiInterface)
Class Documentation¶
-
class FilteredCanInterface : public hi_can::CanInterface¶
Inheritance diagram for hi_can::FilteredCanInterface:
Collaboration diagram for hi_can::FilteredCanInterface:
A variant of CanInterface which contains a whitelist of filters. In the event that there are no filters, all packets are accepted.
Subclassed by hi_can::RawCanInterface, hi_can::SoftwareFilteredCanInterface, hi_can::TwaiInterface
Public Functions¶
-
virtual FilteredCanInterface &add_filter(const addressing::filter_t &filter)¶
Add a filter to the interface.
- Returns:¶
Itself for chaining
-
virtual FilteredCanInterface &remove_filter(const addressing::filter_t &filter)¶
Remove a filter from the interface.
- Returns:¶
Itself for chaining
-
inline virtual const std::set<addressing::filter_t> &get_filters() const¶
Get the currently active filters.
- Returns:¶
The set of active filters
-
virtual std::optional<addressing::filter_t> find_matching_filter(const addressing::flagged_address_t &address) const¶
Find the first filter which matches the given address.
- Parameters:¶
- const addressing::flagged_address_t &address¶
The address to search for
- Returns:¶
The matching filter if found, otherwise std::nullopt
-
virtual bool address_matches_filters(const addressing::flagged_address_t &address) const¶
Check if an address matches any of the filters.
- Parameters:¶
- const addressing::flagged_address_t &address¶
The address to check
- Returns:¶
Whether the address matches a filter
-
virtual FilteredCanInterface &add_filter(const addressing::filter_t &filter)¶