Skip to content

Commit

Permalink
[Examples]: Changed examples that use TC client to have a more specif…
Browse files Browse the repository at this point in the history
…ic NAME filter

Changed examples that use TC clients to lock onto TCs with:
Device Class 0
Industry Group 2
Function Instance 0
Function 130

This should resolve issues some people see when their bus has CFs
with overlapping function codes.
  • Loading branch information
ad3154 committed Feb 15, 2024
1 parent b8bb422 commit 135fe2c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
8 changes: 7 additions & 1 deletion examples/seeder_example/seeder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,14 @@ bool Seeder::initialize()

const isobus::NAMEFilter filterVirtualTerminal(isobus::NAME::NAMEParameters::FunctionCode, static_cast<std::uint8_t>(isobus::NAME::Function::VirtualTerminal));
const isobus::NAMEFilter filterTaskController(isobus::NAME::NAMEParameters::FunctionCode, static_cast<std::uint8_t>(isobus::NAME::Function::TaskController));
const isobus::NAMEFilter filterTaskControllerInstance(isobus::NAME::NAMEParameters::FunctionInstance, 0);
const isobus::NAMEFilter filterTaskControllerIndustryGroup(isobus::NAME::NAMEParameters::IndustryGroup, static_cast<std::uint8_t>(isobus::NAME::IndustryGroup::AgriculturalAndForestryEquipment));
const isobus::NAMEFilter filterTaskControllerDeviceClass(isobus::NAME::NAMEParameters::DeviceClass, static_cast<std::uint8_t>(isobus::NAME::DeviceClass::NonSpecific));
const std::vector<isobus::NAMEFilter> tcNameFilters = { filterTaskController,
filterTaskControllerInstance,
filterTaskControllerIndustryGroup,
filterTaskControllerDeviceClass };
const std::vector<isobus::NAMEFilter> vtNameFilters = { filterVirtualTerminal };
const std::vector<isobus::NAMEFilter> tcNameFilters = { filterTaskController };
auto InternalECU = isobus::InternalControlFunction::create(TestDeviceNAME, 0x81, 0);
auto PartnerVT = isobus::PartneredControlFunction::create(0, vtNameFilters);
auto PartnerTC = isobus::PartneredControlFunction::create(0, tcNameFilters);
Expand Down
7 changes: 6 additions & 1 deletion examples/task_controller_client/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,12 @@ int main()

const isobus::NAMEFilter filterTaskController(isobus::NAME::NAMEParameters::FunctionCode, static_cast<std::uint8_t>(isobus::NAME::Function::TaskController));
const isobus::NAMEFilter filterTaskControllerInstance(isobus::NAME::NAMEParameters::FunctionInstance, 0);
const std::vector<isobus::NAMEFilter> tcNameFilters = { filterTaskController, filterTaskControllerInstance };
const isobus::NAMEFilter filterTaskControllerIndustryGroup(isobus::NAME::NAMEParameters::IndustryGroup, static_cast<std::uint8_t>(isobus::NAME::IndustryGroup::AgriculturalAndForestryEquipment));
const isobus::NAMEFilter filterTaskControllerDeviceClass(isobus::NAME::NAMEParameters::DeviceClass, static_cast<std::uint8_t>(isobus::NAME::DeviceClass::NonSpecific));
const std::vector<isobus::NAMEFilter> tcNameFilters = { filterTaskController,
filterTaskControllerInstance,
filterTaskControllerIndustryGroup,
filterTaskControllerDeviceClass };
auto TestInternalECU = isobus::InternalControlFunction::create(TestDeviceNAME, 0x1C, 0);
auto TestPartnerTC = isobus::PartneredControlFunction::create(0, tcNameFilters);

Expand Down

0 comments on commit 135fe2c

Please sign in to comment.