Skip to content

Add VirtualTerminalClient::get_state() - #14

Open
Arjan-Woltjer wants to merge 1 commit into
Open-Agriculture:mainfrom
Arjan-Woltjer:add-vt-client-get-state
Open

Add VirtualTerminalClient::get_state()#14
Arjan-Woltjer wants to merge 1 commit into
Open-Agriculture:mainfrom
Arjan-Woltjer:add-vt-client-get-state

Conversation

@Arjan-Woltjer

Copy link
Copy Markdown

Summary

Mirrors TaskControllerClient::get_state(), which already exposes its internal state machine state via a public accessor -- VirtualTerminalClient had no equivalent. get_is_connected() is currently the only public signal, and it only reports true once the entire handshake/upload/activate sequence completes -- there's no way for a consumer to distinguish "stuck waiting for VT status" from "uploading the pool" from "waiting for the end-of-pool response" while getting there.

This is useful for diagnostics/debug UI during real hardware bring-up, where a bare boolean makes it hard to tell how far a stuck connection actually got.

Changes

  • isobus_virtual_terminal_client.hpp: declare StateMachineState get_state() const; next to get_is_connected().
  • isobus_virtual_terminal_client.cpp: define it, returning the private state member -- same shape as TaskControllerClient::get_state().

Pure accessor addition, no behavioral change to existing code.

Test plan

  • Build-verified against a real ISOBUS project targeting Teensy 4.1 (arm-none-eabi toolchain), with a real consumer calling the new accessor to drive a debug-menu state display.
  • No existing tests/behavior affected (pure additive accessor).

Mirrors TaskControllerClient::get_state(), which already exposes its
internal state machine state via a public accessor -- VirtualTerminalClient
had no equivalent. get_is_connected() only reports true once the entire
handshake/upload/activate sequence completes, with no way for a consumer to
distinguish "stuck waiting for VT status" from "uploading the pool" from
"waiting for the end-of-pool response" while getting there.

Build-verified against a real Teensy 4.1 ISOBUS project (teensy41 platform,
arm-none-eabi toolchain) with a real consumer calling the new accessor.
@Arjan-Woltjer
Arjan-Woltjer marked this pull request as ready for review August 11, 2026 07:37

@Arjan-Woltjer Arjan-Woltjer left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit acually helped a lot during testing of our objectpool. I think the upstream users should benefit from this as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant