From bb965173b4cb86b3c5e08f5621320a42434c3b2f Mon Sep 17 00:00:00 2001 From: John Date: Sun, 20 Feb 2022 19:30:23 +0100 Subject: [PATCH] add more info from next fw version --- docs/enhanced_proto.md | 4 +++- src/lib/ebus/device.cpp | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/enhanced_proto.md b/docs/enhanced_proto.md index 716fd3ce..85b9b70b 100644 --- a/docs/enhanced_proto.md +++ b/docs/enhanced_proto.md @@ -111,9 +111,11 @@ These are the predefined symbols as used above. The first level below is the `info_id` value and the second level describes the response data byte sequence. The first byte transferred in response is always the number of data bytes to be transferred (excluding the length itself). * 0x00: version - * `length`: =2 + * `length`: =5 (2 before 20220220) * `version`: version number * `features`: feature bits + * `checksum_H` `checksum_L`: checksum (since 20220220) + * `jumpers`: jumper settings * 0x01: PIC ID * `length`: =9 * 9*`mui`: PIC MUI diff --git a/src/lib/ebus/device.cpp b/src/lib/ebus/device.cpp index 8c72099c..40ec8658 100755 --- a/src/lib/ebus/device.cpp +++ b/src/lib/ebus/device.cpp @@ -613,8 +613,14 @@ bool Device::read(symbol_t* value, bool isAvailable, ArbitrationState* arbitrati ostringstream stream; switch ((m_infoLen << 8) | m_infoId) { case 0x0200: + case 0x0500: // with firmware version and jumper info stream << "firmware " << static_cast(m_infoBuf[0]) << "." << std::hex << static_cast(m_infoBuf[1]); + if (m_infoLen>4) { + stream << " [" << std::hex << static_cast(m_infoBuf[2]) + << static_cast(m_infoBuf[3]) << "]"; + stream << ", jumpers 0x" << std::hex << static_cast(m_infoBuf[4]); + } break; case 0x0901: case 0x0802: @@ -623,6 +629,11 @@ bool Device::read(symbol_t* value, bool isAvailable, ArbitrationState* arbitrati for (uint8_t pos = 0; pos < m_infoPos; pos++) { stream << " " << std::setw(2) << static_cast(m_infoBuf[pos]); } + if (m_infoId == 2 && m_infoBuf[2]!=0x3f) { + // non-default arbitration delay + val = (m_infoBuf[2]&0x3f)*10; // steps of 10us + stream << ", arbitration delay " << std::dec << static_cast(val) << " us"; + } break; case 0x0203: val = (static_cast(m_infoBuf[0]) << 8) | static_cast(m_infoBuf[1]);