Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ FetchContent_MakeAvailable(Boost)
FetchContent_Declare(
isobus
GIT_REPOSITORY https://github.com/Open-Agriculture/AgIsoStack-plus-plus.git
GIT_TAG c0e1ebb06a2ad9d5bf86c98b3d028ab8fa350130
GIT_TAG 1d081d9a9df61e256015efda3683d15c8fa3d580
DOWNLOAD_EXTRACT_TIMESTAMP TRUE)
FetchContent_MakeAvailable(isobus)

Expand Down
1 change: 0 additions & 1 deletion include/app.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ class Application
std::unique_ptr<isobus::VirtualTerminalClientUpdateHelper> vtUpdateHelper;
std::vector<std::uint8_t> vtObjectPool;
bool vtClientStarted = false;
bool canHardwareStarted = false; ///< CANHardwareInterface::start() succeeded, so stop() has a thread to stop
bool vtConfigSynced = false;
bool vtWasConnected = false;
bool vtConnectionWarningLogged = false;
Expand Down
10 changes: 6 additions & 4 deletions src/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,10 @@ bool Application::setup_can_hardware()
isobus::CANHardwareInterface::set_number_of_can_channels(1);
isobus::CANHardwareInterface::assign_can_channel_frame_handler(0, canDriver);

canHardwareStarted = isobus::CANHardwareInterface::start();
if ((!canHardwareStarted) || (!canDriver->get_is_valid()))
if ((!isobus::CANHardwareInterface::start()) || (!canDriver->get_is_valid()))
{
log() << "Failed to start CAN hardware interface." << std::endl;
const std::string reason = canDriver->get_last_error();
log() << "Failed to start CAN hardware interface." << (reason.empty() ? "" : " " + reason) << std::endl;
return false;
}

Expand Down Expand Up @@ -1448,7 +1448,9 @@ void Application::stop()
{
tcServer->terminate();
}
if (canHardwareStarted)
// start() also starts the update thread when the driver fails to open, so check is_running()
// rather than whether start() succeeded.
if (isobus::CANHardwareInterface::is_running())
{
isobus::CANHardwareInterface::stop();
}
Expand Down
Loading