Skip to content

Commit a2cdca9

Browse files
committed
Update AgIsoStack
Updated the version of AgIsoStack++ to 867d2c0d02a31f97c17aab2d17970f650db1bf8e
1 parent e115b7f commit a2cdca9

File tree

72 files changed

+24026
-3320
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+24026
-3320
lines changed

examples/VirtualTerminal/VirtualTerminal.ino

+3-5
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ auto can0 = std::make_shared<FlexCANT4Plugin>(0);
88
std::shared_ptr<InternalControlFunction> ISOBUSControlFunction = nullptr;
99
std::shared_ptr<DiagnosticProtocol> ISOBUSDiagnostics = nullptr;
1010
std::shared_ptr<VirtualTerminalClient> ExampleVirtualTerminalClient = nullptr;
11-
std::shared_ptr<void> softKeyListener = nullptr;
12-
std::shared_ptr<void> buttonListener = nullptr;
1311

1412
// A log sink for the CAN stack
1513
class CustomLogger : public CANStackLogger
@@ -146,9 +144,9 @@ void setup() {
146144
const std::vector<NAMEFilter> vtNameFilters = { filterVirtualTerminal };
147145
auto TestPartnerVT = PartneredControlFunction::create(0, vtNameFilters);
148146
ExampleVirtualTerminalClient = std::make_shared<VirtualTerminalClient>(TestPartnerVT, ISOBUSControlFunction);
149-
ExampleVirtualTerminalClient->set_object_pool(0, VirtualTerminalClient::VTVersion::Version3, VT3TestPool, sizeof(VT3TestPool), "AIS1");
150-
softKeyListener = ExampleVirtualTerminalClient->add_vt_soft_key_event_listener(handleVTKeyEvents);
151-
buttonListener = ExampleVirtualTerminalClient->add_vt_button_event_listener(handleVTKeyEvents);
147+
ExampleVirtualTerminalClient->set_object_pool(0, VT3TestPool, sizeof(VT3TestPool), "AIS1");
148+
ExampleVirtualTerminalClient->get_vt_button_event_dispatcher().add_listener(handleVTKeyEvents);
149+
ExampleVirtualTerminalClient->get_vt_button_event_dispatcher().add_listener(handleVTKeyEvents);
152150
ExampleVirtualTerminalClient->initialize(false);
153151
}
154152

library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=AgIsoStack
2-
version=0.1.1
2+
version=0.1.4
33
license=MIT
44
author=Adrian Del Grosso <[email protected]>
55
maintainer=Adrian Del Grosso <[email protected]>

src/AgIsoStack.hpp

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/*******************************************************************************
22
** @file AgIsoStack.hpp
33
** @author Automatic Code Generation
4-
** @date September 09, 2023 at 11:11:41
4+
** @date February 08, 2024 at 19:36:28
55
** @brief Includes all important files in the AgIsoStack library.
66
**
7-
** Copyright 2023 The AgIsoStack++ Developers
7+
** Copyright 2024 The AgIsoStack++ Developers
88
*******************************************************************************/
99

1010
#ifndef AG_ISO_STACK_HPP
@@ -23,6 +23,7 @@
2323
#include <can_identifier.hpp>
2424
#include <can_internal_control_function.hpp>
2525
#include <can_message.hpp>
26+
#include <can_message_data.hpp>
2627
#include <can_message_frame.hpp>
2728
#include <can_NAME.hpp>
2829
#include <can_NAME_filter.hpp>
@@ -33,29 +34,38 @@
3334
#include <can_protocol.hpp>
3435
#include <can_stack_logger.hpp>
3536
#include <can_transport_protocol.hpp>
37+
#include <can_transport_protocol_base.hpp>
3638
#include <circular_buffer.hpp>
39+
#include <data_span.hpp>
3740
#include <event_dispatcher.hpp>
3841
#include <FlexCAN_T4.hpp>
3942
#include <flex_can_t4_plugin.hpp>
4043
#include <imxrt_flexcan.hpp>
44+
#include <isobus_data_dictionary.hpp>
4145
#include <isobus_device_descriptor_object_pool.hpp>
4246
#include <isobus_diagnostic_protocol.hpp>
4347
#include <isobus_functionalities.hpp>
4448
#include <isobus_guidance_interface.hpp>
4549
#include <isobus_language_command_interface.hpp>
4650
#include <isobus_maintain_power_interface.hpp>
51+
#include <isobus_preferred_addresses.hpp>
4752
#include <isobus_shortcut_button_interface.hpp>
4853
#include <isobus_speed_distance_messages.hpp>
4954
#include <isobus_standard_data_description_indices.hpp>
5055
#include <isobus_task_controller_client.hpp>
5156
#include <isobus_task_controller_client_objects.hpp>
5257
#include <isobus_virtual_terminal_client.hpp>
58+
#include <isobus_virtual_terminal_client_state_tracker.hpp>
59+
#include <isobus_virtual_terminal_client_update_helper.hpp>
5360
#include <isobus_virtual_terminal_objects.hpp>
5461
#include <kinetis_flexcan.hpp>
5562
#include <nmea2000_fast_packet_protocol.hpp>
63+
#include <nmea2000_message_definitions.hpp>
64+
#include <nmea2000_message_interface.hpp>
5665
#include <platform_endianness.hpp>
5766
#include <processing_flags.hpp>
5867
#include <system_timing.hpp>
68+
#include <thread_synchronization.hpp>
5969
#include <to_string.hpp>
6070

6171
#endif // AG_ISO_STACK_HPP

src/can_NAME_filter.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,4 @@ namespace isobus
9595
return retVal;
9696
}
9797

98-
} // namespace isobus
98+
} // namespace isobus

src/can_NAME_filter.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ namespace isobus
3939
std::uint32_t get_value() const;
4040

4141
/// @brief Returns true if a NAME matches this filter class's components
42+
/// @param[in] nameToCompare A NAME to compare against this filter
4243
/// @returns true if a NAME matches this filter class's components
4344
bool check_name_matches_filter(const NAME &nameToCompare) const;
4445

src/can_address_claim_state_machine.hpp

+3
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,16 @@ namespace isobus
8989
static void process_rx_message(const CANMessage &message, void *parentPointer);
9090

9191
/// @brief Sets the current state machine state
92+
/// @param[in] value The state to set the state machine to
9293
void set_current_state(State value);
9394

9495
/// @brief Sends the PGN request for the address claim PGN
96+
/// @returns true if the message was sent, otherwise false
9597
bool send_request_to_claim() const;
9698

9799
/// @brief Sends the address claim message
98100
/// @param[in] address The address to claim
101+
/// @returns true if the message was sent, otherwise false
99102
bool send_address_claim(std::uint8_t address);
100103

101104
NAME m_isoname; ///< The ISO NAME to claim as

src/can_callbacks.hpp

+10
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#ifndef CAN_CALLBACKS_HPP
1111
#define CAN_CALLBACKS_HPP
1212

13+
#include <functional>
1314
#include "can_message.hpp"
1415

1516
namespace isobus
@@ -36,6 +37,14 @@ namespace isobus
3637

3738
/// @brief A callback for control functions to get CAN messages
3839
using CANLibCallback = void (*)(const CANMessage &message, void *parentPointer);
40+
/// @brief A callback for communicating CAN messages
41+
using CANMessageCallback = std::function<void(const CANMessage &message)>;
42+
/// @brief A callback for communicating CAN message frames
43+
using CANMessageFrameCallback = std::function<bool(std::uint32_t parameterGroupNumber,
44+
CANDataSpan data,
45+
std::shared_ptr<InternalControlFunction> sourceControlFunction,
46+
std::shared_ptr<ControlFunction> destinationControlFunction,
47+
CANIdentifier::CANPriority priority)>; ///< A callback for sending a CAN frame
3948
/// @brief A callback that can inform you when a control function changes state between online and offline
4049
using ControlFunctionStateCallback = void (*)(std::shared_ptr<ControlFunction> controlFunction, ControlFunctionState state);
4150
/// @brief A callback to get chunks of data for transfer by a protocol
@@ -101,6 +110,7 @@ namespace isobus
101110
CANLibCallback get_callback() const;
102111

103112
/// @brief Returns the parent pointer for this data object
113+
/// @returns The parent pointer for this data object
104114
void *get_parent() const;
105115

106116
/// @brief Returns the ICF being used as a filter for this callback

src/can_constants.hpp

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#ifndef CAN_CONSTANTS_HPP
1010
#define CAN_CONSTANTS_HPP
1111

12+
#include <cstdint>
13+
1214
namespace isobus
1315
{
1416
constexpr std::uint64_t DEFAULT_NAME = 0xFFFFFFFFFFFFFFFF; ///< An invalid NAME used as a default
@@ -17,6 +19,7 @@ namespace isobus
1719
constexpr std::uint8_t BROADCAST_CAN_ADDRESS = 0xFF; ///< The global/broadcast CAN address
1820
constexpr std::uint8_t CAN_DATA_LENGTH = 8; ///< The length of a classical CAN frame
1921
constexpr std::uint32_t CAN_PORT_MAXIMUM = 4; ///< An arbitrary limit for memory consumption
22+
constexpr std::uint16_t NULL_OBJECT_ID = 65535; ///< Special ID used to indicate no object
2023

2124
}
2225

src/can_control_function.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ namespace isobus
4343
/// @param[in] NAMEValue The NAME of the control function
4444
/// @param[in] addressValue The current address of the control function
4545
/// @param[in] CANPort The CAN channel index that the control function communicates on
46+
/// @returns A shared pointer to a ControlFunction object created with the parameters passed in
4647
static std::shared_ptr<ControlFunction> create(NAME NAMEValue, std::uint8_t addressValue, std::uint8_t CANPort);
4748

4849
/// @brief Destroys this control function, by removing it from the network manager
@@ -82,7 +83,7 @@ namespace isobus
8283
/// @param[in] type The 'Type' of control function to create
8384
ControlFunction(NAME NAMEValue, std::uint8_t addressValue, std::uint8_t CANPort, Type type = Type::External);
8485

85-
friend class CANNetworkManager;
86+
friend class CANNetworkManager; ///< The network manager needs access to the control function's internals
8687
#if !defined CAN_STACK_DISABLE_THREADS && !defined ARDUINO
8788
static std::mutex controlFunctionProcessingMutex; ///< Protects the control function tables
8889
#endif

0 commit comments

Comments
 (0)