From d2ea1d75430d6693fe83a4a6df1032a6a488f71f Mon Sep 17 00:00:00 2001 From: Pat-I <66231833+Pat-I@users.noreply.github.com> Date: Thu, 5 Feb 2026 22:10:23 -0500 Subject: [PATCH] 64 sections support 64 sections support --- src/app.cpp | 15 ++++++--------- src/task_controller.cpp | 4 ++-- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/app.cpp b/src/app.cpp index 0c10ed3..e11ba02 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -134,19 +134,16 @@ bool Application::initialize() static std::uint32_t lastXteTransmit = 0; auto packetHandler = [this, tcCF](std::uint8_t src, std::uint8_t pgn, std::span data) { - if (src == 0x7F && pgn == 0xFE) // 254 - Steer Data + if (src == 0x7F && pgn == 0xE5) // 229 - 64 sections PGN { - // TODO: hack to get desired section states. probably want to make a new pgn later when we need more than 16 sections std::vector sectionStates; - for (std::uint8_t i = 0; i < 8; i++) + for (std::uint8_t j = 0; j < 8; j++) { - sectionStates.push_back(data[6] & (1 << i)); - } - for (std::uint8_t i = 0; i < 8; i++) - { - sectionStates.push_back(data[7] & (1 << i)); + for (std::uint8_t i = 0; i < 8; i++) + { + sectionStates.push_back(data[j] & (1 << i)); + } } - tcServer->update_section_states(sectionStates); } else if (src == 0x7F && pgn == 0xF1) // 241 - Section Control diff --git a/src/task_controller.cpp b/src/task_controller.cpp index 72a0567..3d7e61f 100644 --- a/src/task_controller.cpp +++ b/src/task_controller.cpp @@ -228,8 +228,8 @@ bool ClientState::try_get_element_work_state(std::uint16_t elementNumber, bool & MyTCServer::MyTCServer(std::shared_ptr internalControlFunction) : TaskControllerServer(internalControlFunction, 1, // AOG limits to 1 boom - 16, // AOG limits to 16 sections of unique width - 16, // 16 channels for position based control + 64, // AOG limits to 16 sections of unique width but can be 64 by using zones + 64, // 64 channels for position based control isobus::TaskControllerOptions() .with_implement_section_control(), // We support section control TaskControllerVersion::SecondEditionDraft)