Skip to content

Configurable TC version/locale settings from PR #47#55

Merged
gunicsba merged 3 commits into
developfrom
copilot/carry-forward-tc-functionalities
Jun 1, 2026
Merged

Configurable TC version/locale settings from PR #47#55
gunicsba merged 3 commits into
developfrom
copilot/carry-forward-tc-functionalities

Conversation

Copilot AI commented May 31, 2026

Copy link
Copy Markdown
Contributor

Extracts the configurable TC version/locale settings from PR #47 into a focused, production-ready change.

Settings (settings.hpp / settings.cpp)

  • Added get/set_tc_version() — maps 0–4 to TaskControllerVersion enum; default 3 (SecondEditionDraft) for maximum implement compatibility
  • Added get/set_language_code() and get/set_country_code() — defaults "en" / "US"
  • All three settings are persisted to / loaded from settings.json

TC Server (task_controller.hpp / task_controller.cpp)

  • MyTCServer constructor now accepts an optional TaskControllerVersion parameter (default: SecondEditionDraft, preserving backward compatibility)

Application (app.hpp / app.cpp)

  • tcServer is created with the version and locale read from settings instead of hardcoded values

Explicitly excluded from this PR: TC status burst, tcFunctionalities capability announcement, VersionPayload exchange, debug/logging scaffolding, directory archival changes.

Original prompt

Create a new pull request in AgOpenGPS-Official/AOG-TaskController by selectively carrying forward only part of the work from PR #47 ("Add extra logging to understand which ECU-s are on the bus").

Context:

Required scope for this PR:

  1. Carry over the tcFunctionalities work and everything directly related to it:

    • std::unique_ptr<isobus::ControlFunctionFunctionalities> tcFunctionalities;
    • Ensure any initialization, lifecycle, request/response handling, and integration points required for this functionality are included.
    • Keep the implementation minimal and production-ready; omit unrelated experimentation and debug scaffolding.
  2. Carry over the TC version and locale helper API and related logic:

    • std::uint8_t get_tc_version() const;
    • std::string get_language_code() const;
    • std::string get_country_code() const;
    • Include the corresponding setters as well.
    • Retain or implement the underlying state needed for these APIs, including defaults such as DEFAULT_TC_VERSION, DEFAULT_LANGUAGE_CODE, and DEFAULT_COUNTRY_CODE if still appropriate.
  3. Implement the VersionPayload exchange toward the implement:

    • Do the request/response dance for the VersionPayload request toward the implement.
    • Integrate this cleanly with the retained TC version / language / country code functionality.
    • Keep behavior aligned with existing project patterns and ISOBUS abstractions already used in the repository.

Explicit exclusions:

  • Do not include TC burst changes.
  • Do not include extra capabilities work unless required to support tcFunctionalities.
  • Do not include extra logging/debug instrumentation.
  • Do not include directory archival changes.
  • Do not include unrelated cleanup or refactors.

Implementation guidance:

Deliverable:

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: ```
constexpr static std::uint8_t DEFAULT_TC_VERSION = 3; // SecondEditionDraft (V3 default for maximum implement compatibility)
static const std::string DEFAULT_LANGUAGE_CODE;
static const std::string DEFAULT_COUNTRY_CODE;

This PR was more like an experiment to understand why the TC fails for some reason.

I'd like you to create a new PR and I'll explain what needs to be carried over.

1 PR about the tcFunctionalities and everything that is related to this:
	std::unique_ptr<isobus::ControlFunctionFunctionalities> tcFunctionalities;

1 PR about the TC_version and other helper functions:
std::uint8_t get_tc_version() const;
std::string get_language_code() const;
std::string get_country_code() const;
(and the setters too)
Do the dance for the VersionPayload request towards the implement.



TC burst, capabilites, extra logging stuff is not needed for now.
Also the directory archival we can skip.




Assistant: I'm waiting for your confirmation on the new pull request task, and once you respond I can continue.

User: @Copilot Accepted Confirmation: Confirm cloud agent session

Assistant: The PR creation didn’t start because the base branch `master` does not exist in `AgOpenGPS-Official/AOG-TaskController`.

If you want, I can retry immediately — either:
- with the repo’s default branch, or
- with the correct branch name if you tell me what it is.

User: use the repos default branch

Assistant: I’ve queued it to use the repository’s default branch, and I’m now waiting for your confirmation so I can start creating the new PR.


This pull request was created from Copilot chat.

…ionPayload exchange from PR #47

- Settings: add get/set_tc_version, get/set_language_code, get/set_country_code with JSON persistence
- MyTCServer: accept configurable TaskControllerVersion (default SecondEditionDraft)
- app: initialize tcFunctionalities announcing TC-BAS + TC-SC (1 boom / 64 sections)
- app: create tcServer with version and locale from settings
- app: drive bidirectional VersionPayload exchange via ProcessData PGN callback
Copilot AI changed the title [WIP] Selective carry forward of tcFunctionalities work from PR #47 Carry forward tcFunctionalities, configurable TC version/locale, and VersionPayload exchange from PR #47 May 31, 2026
Copilot AI requested a review from gunicsba May 31, 2026 19:58

@gunicsba gunicsba left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@copilot I wanted the tcFunctionalities should be in a separate PR. Could we remove all those and keep the rest?
I think the tcFunctionality response should be inside the stack.

Comment thread include/settings.hpp Outdated
Comment thread include/settings.hpp Outdated
Comment thread include/settings.hpp Outdated
Comment thread include/settings.hpp Outdated
Comment thread include/settings.hpp Outdated
Comment thread include/settings.hpp Outdated
Comment thread src/app.cpp Outdated

Copilot AI commented May 31, 2026

Copy link
Copy Markdown
Contributor Author

@gunicsba I've opened a new pull request, #56, to work on those changes. Once the pull request is ready, I'll request review from you.

Comment thread src/app.cpp Outdated
@gunicsba

Copy link
Copy Markdown
Contributor

@copilot please implement the changes requested in the review / comments

Copilot AI commented May 31, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please implement the changes requested in the review / comments

Done. All requested changes are addressed in commit $(git rev-parse --short HEAD):

  • Removed all tcFunctionalities init/update code and the on_process_data_pgn_received callback (including its registration/deregistration) from app.cpp and app.hpp
  • Stripped ISO standard names from all settings.hpp doc comments (ISO 11783-10, ISO 639-1, ISO 3166-1 alpha-2)
  • Removed the ISO 11783-12 comment in app.cpp

@copilot I wanted the tcFunctionalities should be in a separate PR. Could we remove all those and keep the rest?
I think the tcFunctionality response should be inside the stack.

All tcFunctionalities code (TC-BAS/TC-GEO/TC-SC announcements, PGN 64654 init, on_process_data_pgn_received VersionPayload callback, and the implementVersionRequested tracking set) has been removed. The TC version/locale settings are kept.

Copilot AI changed the title Carry forward tcFunctionalities, configurable TC version/locale, and VersionPayload exchange from PR #47 Configurable TC version/locale settings from PR #47 May 31, 2026
Copilot AI requested a review from gunicsba May 31, 2026 20:46

@gunicsba gunicsba left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes look good it should make the Task Controller more flexible this way.

@gunicsba gunicsba marked this pull request as ready for review May 31, 2026 20:51
@gunicsba gunicsba merged commit 9045ba0 into develop Jun 1, 2026
5 checks passed
@gunicsba gunicsba deleted the copilot/carry-forward-tc-functionalities branch June 1, 2026 05:32
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.

3 participants