Skip to content

Commit

Permalink
Expect Boolean value for --preserveFilters
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterBowman committed Jan 14, 2024
1 parent 5ad0b3b commit ffdb168
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libraries/YarpPlugins/CanBusPeak/DeviceDriverImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ constexpr auto DEFAULT_TX_TIMEOUT_MS = 0; // '0' means no timeout

constexpr auto DEFAULT_BLOCKING_MODE = true;
constexpr auto DEFAULT_ALLOW_PERMISSIVE = false;
constexpr auto DEFAULT_PRESERVE_FILTERS = false;

using namespace roboticslab;

Expand Down Expand Up @@ -74,7 +75,9 @@ bool CanBusPeak::open(yarp::os::Searchable& config)
fileDescriptor = res;
}

if (!config.check("preserveFilters", "don't clear acceptance filters on init"))
auto preserveFilters = config.check("preserveFilters", yarp::os::Value(DEFAULT_PRESERVE_FILTERS), "don't clear acceptance filters on init").asBool();

if (!preserveFilters)
{
res = pcanfd_del_filters(fileDescriptor);

Expand Down

0 comments on commit ffdb168

Please sign in to comment.