VT Client: Add a way to select VT object pool(s) to use based on VT server version#607
Open
VT Client: Add a way to select VT object pool(s) to use based on VT server version#607
Conversation
This change makes it possible for a consumer of the library to choose at runtime which object pool(s) to use based on the version of the VT server.
…bject pools at runtime based on the VT server version
cf01769 to
5861d49
Compare
|
| virtualTerminalClient = std::make_shared<isobus::VirtualTerminalClient>(TestPartnerVT, TestInternalECU); | ||
| virtualTerminalClient->get_vt_soft_key_event_dispatcher().add_listener(handle_softkey_event); | ||
| virtualTerminalClient->get_vt_button_event_dispatcher().add_listener(handle_button_event); | ||
| virtualTerminalClient->set_on_ready_for_object_pool_callback([&version3pool, &version4pool, objectPoolHash](isobus::VirtualTerminalClient::VTVersion version) { |
Contributor
There was a problem hiding this comment.
Maybe a (void)version to suppress the unused parameter warning?
Member
There was a problem hiding this comment.
Instead, I'd say we remove the "version" parameter of the callback altogether. There are many more requirements possible as can be seen in #376. We can just let the application access those via more member functions like get_connected_vt_version() does for the version
martonmiklos
previously approved these changes
Sep 27, 2025
9 tasks
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Describe your changes
This change enables a consumer of our VT client interface to dynamically choose which object pool(s) they want to use by looking at the version reported by the VT server in an event-driven way.
How it works
set_on_ready_for_object_pool_callbackon the VT Client. Once the server's version has been learned, if no object pools have been set by the user for upload, we will call this callback (if its valid). Inside this callback, the user can inspect the version of the VT server (which is passed in) and callset_object_poolorregister_object_pool_data_chunk_callbackto register any number and order of object pools they wish.The user remains free to use the library exactly the same way as before as well. This enhancement is entirely optional to utilize. The actual number of changes to the library itself are pretty minimal to support this.
How has this been tested?
I've added a new example application to the repo that extends the original VT client example to demonstrate this use-case. I validated that when this example is run, two separate pool transfers occur to a VT with version 6 (in my case) and everything seems to work as intended.