Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions src/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::uint8_t> 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<bool> 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
Expand Down
4 changes: 2 additions & 2 deletions src/task_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ bool ClientState::try_get_element_work_state(std::uint16_t elementNumber, bool &
MyTCServer::MyTCServer(std::shared_ptr<isobus::InternalControlFunction> 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)
Expand Down