Skip to content

Commit

Permalink
feat(tc): add has_trigger_method for DPD object
Browse files Browse the repository at this point in the history
  • Loading branch information
GwnDaan committed Jan 12, 2025
1 parent 215079c commit 58686f4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,11 @@ namespace isobus
/// @param[in] methods The new trigger methods bitfield to set
void set_trigger_methods_bitfield(std::uint8_t methods);

/// @brief Tests whether a trigger method is set in the trigger methods bitfield
/// @param method The trigger method to test for
/// @returns `true` if the trigger method is set, otherwise `false`
bool has_trigger_method(DeviceProcessDataObject::AvailableTriggerMethods method);

private:
static const std::string tableID; ///< XML element namespace for DeviceProcessData.
std::uint16_t ddi; ///< Identifier of process data variable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,11 @@ namespace isobus
/// @brief Sends a time interval measurement command.
/// The process data value for this command is the time interval for sending the data element
/// specified by the data dictionary identifier.The client has to send the value of this data
/// element to the TC or DL cyclic with this time interval.
/// element to the TC or DL cyclic with this time interval in milliseconds.
/// @param[in] clientControlFunction The control function to send the message to
/// @param[in] dataDescriptionIndex The data description index of the data element to send the command for
/// @param[in] elementNumber The element number of the data element to send the command for
/// @param[in] timeInterval The time interval for sending the data element specified by the data dictionary identifier.
/// @param[in] timeInterval The time interval in milliseconds for sending the data element specified by the data dictionary identifier.
/// @returns true if the message was sent, otherwise false
bool send_time_interval_measurement_command(std::shared_ptr<ControlFunction> clientControlFunction, std::uint16_t dataDescriptionIndex, std::uint16_t elementNumber, std::uint32_t timeInterval) const;

Expand Down
5 changes: 5 additions & 0 deletions isobus/src/isobus_task_controller_client_objects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,11 @@ namespace isobus
triggerMethodsBitfield = methods;
}

bool DeviceProcessDataObject::has_trigger_method(DeviceProcessDataObject::AvailableTriggerMethods method)
{
return (0 != (triggerMethodsBitfield & static_cast<std::uint8_t>(method)));
}

const std::string DevicePropertyObject::tableID = "DPT";

DevicePropertyObject::DevicePropertyObject(std::string propertyDesignator,
Expand Down

0 comments on commit 58686f4

Please sign in to comment.