Skip to content

Commit

Permalink
Check for missing hardware interfaces that use the gpio tag. (#975)
Browse files Browse the repository at this point in the history
Co-authored-by: Ryan Sandzimier <[email protected]>
  • Loading branch information
bmagyar and rsandzimier-machina authored Mar 20, 2023
1 parent 1d6ac80 commit 7422030
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions hardware_interface/src/resource_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,23 @@ void ResourceManager::validate_storage(
}
}
}
for (const auto & gpio : hardware.gpios)
{
for (const auto & state_interface : gpio.state_interfaces)
{
if (!state_interface_exists(gpio.name + "/" + state_interface.name))
{
missing_state_keys.emplace_back(gpio.name + "/" + state_interface.name);
}
}
for (const auto & command_interface : gpio.command_interfaces)
{
if (!command_interface_exists(gpio.name + "/" + command_interface.name))
{
missing_command_keys.emplace_back(gpio.name + "/" + command_interface.name);
}
}
}
}

if (!missing_state_keys.empty() || !missing_command_keys.empty())
Expand Down

0 comments on commit 7422030

Please sign in to comment.