From e883f213648ef9b6588c3a5c23684f17f069faf7 Mon Sep 17 00:00:00 2001 From: Arjan Woltjer Date: Tue, 11 Aug 2026 09:34:01 +0200 Subject: [PATCH] Decode End of Object Pool response error bits in the log The Object Pool Error Codes byte (ISO 11783-6:2004 section C.2.5) was only ever logged as a raw integer, leaving every rejection to be looked up against the standard by hand. Adds per-bit decoding into the existing LOG_ERROR call: bit 0 (method/attribute not supported), bit 1 (unknown object reference), bit 2 (other error). Bit 3 (pool deleted from volatile memory) is suppressed unless it's the only bit set, since the standard states a VT should delete the pool from volatile memory on any error at all -- it rides along with essentially every rejection and isn't itself diagnostic on its own. Logging-only change, no control flow affected. Verified against a real rejection on hardware (a Fendt Universal Terminal reporting bitmask value 9 == bit 0 + bit 3) that previously required a manual trip to the ISO standard text to decode; now reads directly off the log. --- src/isobus_virtual_terminal_client.cpp | 30 ++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/isobus_virtual_terminal_client.cpp b/src/isobus_virtual_terminal_client.cpp index c887c6e..0350629 100644 --- a/src/isobus_virtual_terminal_client.cpp +++ b/src/isobus_virtual_terminal_client.cpp @@ -3116,6 +3116,36 @@ namespace isobus { LOG_ERROR("[VT]: Reported other errors in EOM response"); } + // Decode the Object Pool Error Codes byte per ISO 11783-6 (2004) + // section C.2.5 "End of Object Pool Response message", so a + // rejection doesn't need to be looked up against the standard by + // hand every time. Bit 3 is boilerplate (the standard states a VT + // should delete the pool from volatile memory on any error at + // all), so it's only surfaced when it's the sole bit set, which + // would itself be unusual and worth knowing about. + if (0 != objectPoolErrorBitmask) + { + bool decodedAnyBit = false; + if (0 != (objectPoolErrorBitmask & 0x01)) + { + LOG_ERROR("[VT]: Object pool error bit 0: method or attribute not supported by the VT."); + decodedAnyBit = true; + } + if (0 != (objectPoolErrorBitmask & 0x02)) + { + LOG_ERROR("[VT]: Object pool error bit 1: unknown object reference (missing object)."); + decodedAnyBit = true; + } + if (0 != (objectPoolErrorBitmask & 0x04)) + { + LOG_ERROR("[VT]: Object pool error bit 2: any other error."); + decodedAnyBit = true; + } + if ((0 != (objectPoolErrorBitmask & 0x08)) && (!decodedAnyBit)) + { + LOG_ERROR("[VT]: Object pool error bit 3 only: pool deleted from volatile memory, no other error bit set (unusual -- normally rides along with bit 0/1/2)."); + } + } } } }