Skip to content

Commit

Permalink
[VT]: Misc rebase fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
ad3154 committed Apr 25, 2024
1 parent 1b51754 commit bb24496
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "isobus/isobus/can_badge.hpp"
#include "isobus/isobus/can_control_function.hpp"
#include "isobus/isobus/isobus_virtual_terminal_objects.hpp"
#include "isobus/utility/event_dispatcher.hpp"

namespace isobus
{
Expand Down Expand Up @@ -78,7 +79,7 @@ namespace isobus

/// @brief Saves an event callback handle for the lifetime of this object
/// which is useful for keeping track of callback lifetimes in a VT server
void save_callback_handle(std::shared_ptr<void> callbackHandle);
void save_callback_handle(isobus::EventCallbackHandle callbackHandle);

/// @brief Clears all event callback handles for the this working set
/// which is useful if you want to stop drawing this working set
Expand Down Expand Up @@ -159,7 +160,7 @@ namespace isobus
std::unique_ptr<std::thread> objectPoolProcessingThread = nullptr; ///< A thread to process the object pool with, since that can be fairly time consuming.
std::mutex managedWorkingSetMutex; ///< A mutex to protect the interface of the managed working set
std::shared_ptr<ControlFunction> workingSetControlFunction = nullptr; ///< Stores the control function associated with this working set
std::vector<std::shared_ptr<void>> callbackHandles; ///< A convenient way to associate callback handles to a working set
std::vector<isobus::EventCallbackHandle> callbackHandles; ///< A convenient way to associate callback handles to a working set
ObjectPoolProcessingThreadState processingState = ObjectPoolProcessingThreadState::None; ///< Stores the state of processing the object pool
std::uint32_t workingSetMaintenanceMessageTimestamp_ms = 0; ///< A timestamp (in ms) to track sending of the maintenance message
std::uint32_t auxiliaryInputMaintenanceMessageTimestamp_ms = 0; ///< A timestamp (in ms) to track if/when the working set sent an auxiliary input maintenance message
Expand Down
11 changes: 6 additions & 5 deletions isobus/src/isobus_virtual_terminal_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,6 @@ namespace isobus

if (macro->get_are_command_packets_valid())
{
isobus::CANMessage message(workingSet->get_control_function()->get_can_port());
message.set_destination_control_function(get_internal_control_function());
message.set_source_control_function(workingSet->get_control_function());
message.set_identifier(isobus::CANIdentifier(0x14E70000));
CANStackLogger::debug("[VT Server]: Executing macro %u", macro->get_id());
retVal = true;

Expand All @@ -177,7 +173,12 @@ namespace isobus

if (macro->get_command_packet(j, commandPacket))
{
message.set_data(commandPacket.data(), commandPacket.size());
isobus::CANMessage message(isobus::CANMessage::Type::Receive,
isobus::CANIdentifier(0x14E70000),
commandPacket,
workingSet->get_control_function(),
get_internal_control_function(),
workingSet->get_control_function()->get_can_port());
CANStackLogger::debug("[VT Server]: Executing macro command %u", j);
execute_macro_as_rx_message(message);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ namespace isobus
workingSetMaintenanceMessageTimestamp_ms = value;
}

void VirtualTerminalServerManagedWorkingSet::save_callback_handle(std::shared_ptr<void> callbackHandle)
void VirtualTerminalServerManagedWorkingSet::save_callback_handle(isobus::EventCallbackHandle callbackHandle)
{
callbackHandles.push_back(callbackHandle);
}
Expand Down

0 comments on commit bb24496

Please sign in to comment.