From cca85a389d178402d4b098ec3a7044b96989eb35 Mon Sep 17 00:00:00 2001 From: kricon Date: Tue, 8 Mar 2022 15:02:56 +0100 Subject: [PATCH 1/9] Started implementing module programming decoding 0x8D cmd Just an local dump to show work in progress, will be redone. --- src/dscKeybus.h | 2 +- src/dscKeybusPrintData.cpp | 198 ++++++++++++++++++++++++++++++++++--- 2 files changed, 186 insertions(+), 14 deletions(-) diff --git a/src/dscKeybus.h b/src/dscKeybus.h index da10972..dac4bd7 100644 --- a/src/dscKeybus.h +++ b/src/dscKeybus.h @@ -286,7 +286,7 @@ class dscKeybusInterface { void printModule_KeyCodes(byte keyByte); void printModule_Expander(); bool printModuleSlots(byte startCount, byte startByte, byte endByte, byte startMask, byte endMask, byte bitShift, byte matchValue, bool reverse = false); - void printModuleProgramming(byte panelByte2, byte panelByte3); + void printModuleProgramming(byte panelByte2, byte panelByte3, byte panelByte4, byte panelByte5, byte panelByte6, byte panelByte7); bool validCRC(); void writeKeys(const char * writeKeysArray); diff --git a/src/dscKeybusPrintData.cpp b/src/dscKeybusPrintData.cpp index f634b6c..3c599bb 100644 --- a/src/dscKeybusPrintData.cpp +++ b/src/dscKeybusPrintData.cpp @@ -1923,8 +1923,8 @@ void dscKeybusInterface::printPanel_0x87() { */ void dscKeybusInterface::printPanel_0x8D() { #if !defined(__AVR__) - stream->print(F("Module programming entry: ")); - printModuleProgramming(panelData[2], panelData[3]); + stream->print(F("Module pgm entry: ")); + printModuleProgramming(panelData[2], panelData[3], panelData[4], panelData[5], panelData[6], panelData[7]); #else stream->print(F("Module programming entry")); #endif @@ -1955,8 +1955,8 @@ void dscKeybusInterface::printPanel_0x8D() { */ void dscKeybusInterface::printPanel_0x94() { #if !defined(__AVR__) - stream->print(F("Module programming request: ")); - printModuleProgramming(panelData[2], panelData[3]); + stream->print(F("Module pgm request: ")); + printModuleProgramming(panelData[2], panelData[3], panelData[4], panelData[5], panelData[6], panelData[7]); #else stream->print(F("Module programming request")); #endif @@ -3462,7 +3462,21 @@ void dscKeybusInterface::printModule_0x70() { * Content decoding: *incomplete */ void dscKeybusInterface::printModule_0x94() { - stream->print(F("Module programming response")); + stream->print(F("Module pgm response: ")); + + for (byte moduleByte = 2; moduleByte <= 7; moduleByte ++) { + stream->print(" | Byte"); + stream->print(moduleByte); + stream->print(": "); + if (moduleData[moduleByte] < 16) stream->print("0"); + stream->print(moduleData[moduleByte], HEX); + } + stream->print(" data: "); + for (byte moduleByte = 7; moduleByte <= 10; moduleByte ++) { + byte result = (moduleData[moduleByte] << 1) & (moduleData[moduleByte+1] & 0x80); + stream->print(result >> 4, HEX); + stream->print(result & 0x0F, HEX); + } } @@ -3742,20 +3756,178 @@ bool dscKeybusInterface::printModuleSlots(byte outputNumber, byte startByte, byt // Print 0x8D and 0x94 section and command subsection data used for programming modules -void dscKeybusInterface::printModuleProgramming(byte panelByte2, byte panelByte3) { +void dscKeybusInterface::printModuleProgramming(byte panelByte2, byte panelByte3, byte panelByte4, byte panelByte5, byte panelByte6, byte panelByte7) { switch (panelByte2) { - case 0x11: stream->print(F("RF5132")); break; //section 804 verified on pc1832 and pc5020 - case 0x14: stream->print(F("RF5400")); break; //section 801 not verified + case 0x11: stream->print(F("RF5132")); { + if (panelByte4 == 0x82) { + stream->print(F(": subsection")); + if (panelByte4 < 16) stream->print("0"); + stream->print(panelByte3, HEX); + } + if (panelByte4 == 0x02) { + switch (panelByte3) { + case 0x02: stream->print(F(" v5.x | Keyfob 1 ESN input")); break; + case 0x05: stream->print(F(" v5.x | Keyfob 2 ESN input")); break; + case 0x08: stream->print(F(" v5.x | Keyfob 3 ESN input")); break; + case 0x0B: stream->print(F(" v5.x | Keyfob 4 ESN input")); break; + case 0x0E: stream->print(F(" v5.x | Keyfob 5 ESN input")); break; + case 0x11: stream->print(F(" v5.x | Keyfob 6 ESN input")); break; + case 0x14: stream->print(F(" v5.x | Keyfob 7 ESN input")); break; + case 0x17: stream->print(F(" v5.x | Keyfob 8 ESN input")); break; + case 0x1A: stream->print(F(" v5.x | Keyfob 9 ESN input")); break; + case 0x1D: stream->print(F(" v5.x | Keyfob 10 ESN input")); break; + case 0x20: stream->print(F(" v5.x | Keyfob 11 ESN input")); break; + case 0x23: stream->print(F(" v5.x | Keyfob 12 ESN input")); break; + case 0x26: stream->print(F(" v5.x | Keyfob 13 ESN input")); break; + case 0x29: stream->print(F(" v5.x | Keyfob 14 ESN input")); break; + case 0x2C: stream->print(F(" v5.x | Keyfob 15 ESN input")); break; + case 0x2F: stream->print(F(" v5.x | Keyfob 16 ESN input")); break; + case 0x44: stream->print(F(" v5.x | Zone 1 ESN input")); break; + case 0x45: stream->print(F(" v3.x | Zone 1 ESN input")); break; + case 0x47: stream->print(F(" v5.x | Zone 2 ESN input")); break; + case 0x48: stream->print(F(" v3.x | Zone 2 ESN input")); break; + case 0x4A: stream->print(F(" v5.x | Zone 3 ESN input")); break; + case 0x4B: stream->print(F(" v3.x | Zone 3 ESN input")); break; + case 0x4D: stream->print(F(" v5.x | Zone 4 ESN input")); break; + case 0x4E: stream->print(F(" v3.x | Zone 4 ESN input")); break; + case 0x50: stream->print(F(" v5.x | Zone 5 ESN input")); break; + case 0x51: stream->print(F(" v3.x | Zone 5 ESN input")); break; + case 0x53: stream->print(F(" v5.x | Zone 6 ESN input")); break; + case 0x54: stream->print(F(" v3.x | Zone 6 ESN input")); break; + case 0x56: stream->print(F(" v5.x | Zone 7 ESN input")); break; + case 0x57: stream->print(F(" v3.x | Zone 7 ESN input")); break; + case 0x59: stream->print(F(" v5.x | Zone 8 ESN input")); break; + case 0x5A: stream->print(F(" v3.x | Zone 8 ESN input")); break; + case 0x5C: stream->print(F(" v5.x | Zone 9 ESN input")); break; + case 0x5D: stream->print(F(" v3.x | Zone 9 ESN input")); break; + case 0x5F: stream->print(F(" v5.x | Zone 10 ESN input")); break; + case 0x60: stream->print(F(" v3.x | Zone 10 ESN input")); break; + case 0x62: stream->print(F(" v5.x | Zone 11 ESN input")); break; + case 0x63: stream->print(F(" v3.x | Zone 11 ESN input")); break; + case 0x65: stream->print(F(" v5.x | Zone 12 ESN input")); break; + case 0x66: stream->print(F(" v3.x | Zone 12 ESN input")); break; + case 0x68: stream->print(F(" v5.x | Zone 13 ESN input")); break; + case 0x69: stream->print(F(" v3.x | Zone 13 ESN input")); break; + case 0x6B: stream->print(F(" v5.x | Zone 14 ESN input")); break; + case 0x6C: stream->print(F(" v3.x | Zone 14 ESN input")); break; + case 0x6E: stream->print(F(" v5.x | Zone 15 ESN input")); break; + case 0x6F: stream->print(F(" v3.x | Zone 15 ESN input")); break; + case 0x71: stream->print(F(" v5.x | Zone 16 ESN input")); break; + case 0x72: stream->print(F(" v3.x | Zone 16 ESN input")); break; + case 0x74: stream->print(F(" v5.x | Zone 17 ESN input")); break; + case 0x75: stream->print(F(" v3.x | Zone 17 ESN input")); break; + case 0x77: stream->print(F(" v5.x | Zone 18 ESN input")); break; + case 0x78: stream->print(F(" v3.x | Zone 18 ESN input")); break; + case 0x7A: stream->print(F(" v5.x | Zone 19 ESN input")); break; + case 0x7B: stream->print(F(" v3.x | Zone 19 ESN input")); break; + case 0x7D: stream->print(F(" v5.x | Zone 20 ESN input")); break; + case 0x7E: stream->print(F(" v3.x | Zone 20 ESN input")); break; + case 0x80: stream->print(F(" v5.x | Zone 21 ESN input")); break; + case 0x81: stream->print(F(" v3.x | Zone 21 ESN input")); break; + case 0x83: stream->print(F(" v5.x | Zone 22 ESN input")); break; + case 0x84: stream->print(F(" v3.x | Zone 22 ESN input")); break; + case 0x86: stream->print(F(" v5.x | Zone 23 ESN input")); break; + case 0x87: stream->print(F(" v3.x | Zone 23 ESN input")); break; + case 0x89: stream->print(F(" v5.x | Zone 24 ESN input")); break; + case 0x8A: stream->print(F(" v3.x | Zone 24 ESN input")); break; + case 0x8C: stream->print(F(" v5.x | Zone 25 ESN input")); break; + case 0x8D: stream->print(F(" v3.x | Zone 25 ESN input")); break; + case 0x8F: stream->print(F(" v5.x | Zone 26 ESN input")); break; + case 0x90: stream->print(F(" v3.x | Zone 26 ESN input")); break; + case 0x92: stream->print(F(" v5.x | Zone 27 ESN input")); break; + case 0x93: stream->print(F(" v3.x | Zone 27 ESN input")); break; + case 0x95: stream->print(F(" v5.x | Zone 28 ESN input")); break; + case 0x96: stream->print(F(" v3.x | Zone 28 ESN input")); break; + case 0x98: stream->print(F(" v5.x | Zone 29 ESN input")); break; + case 0x99: stream->print(F(" v3.x | Zone 29 ESN input")); break; + case 0x9B: stream->print(F(" v5.x | Zone 30 ESN input")); break; + case 0x9C: stream->print(F(" v3.x | Zone 30 ESN input")); break; + case 0x9E: stream->print(F(" v5.x | Zone 31 ESN input")); break; + case 0x9F: stream->print(F(" v3.x | Zone 31 ESN input")); break; + case 0xA1: stream->print(F(" v5.x | Zone 32 ESN input")); break; + case 0xA2: stream->print(F(" v3.x | Zone 32 ESN input")); break; + case 0xB1: stream->print(F(" v3.x | Keyfob 1 ESN input")); break; + case 0xB4: stream->print(F(" v3.x | Keyfob 2 ESN input")); break; + case 0xB7: stream->print(F(" v3.x | Keyfob 3 ESN input")); break; + case 0xBA: stream->print(F(" v3.x | Keyfob 4 ESN input")); break; + case 0xBD: stream->print(F(" v3.x | Keyfob 5 ESN input")); break; + case 0xC0: stream->print(F(" v3.x | Keyfob 6 ESN input")); break; + case 0xC3: stream->print(F(" v3.x | Keyfob 7 ESN input")); break; + case 0xC6: stream->print(F(" v3.x | Keyfob 8 ESN input")); break; + case 0xC9: stream->print(F(" v3.x | Keyfob 9 ESN input")); break; + case 0xCC: stream->print(F(" v3.x | Keyfob 10 ESN input")); break; + case 0xCF: stream->print(F(" v3.x | Keyfob 11 ESN input")); break; + case 0xD2: stream->print(F(" v3.x | Keyfob 12 ESN input")); break; + case 0xD5: stream->print(F(" v3.x | Keyfob 13 ESN input")); break; + case 0xD8: stream->print(F(" v3.x | Keyfob 14 ESN input")); break; + case 0xDB: stream->print(F(" v3.x | Keyfob 15 ESN input")); break; + case 0xDE: stream->print(F(" v3.x | Keyfob 16 ESN input")); break; + default: stream->print(" Unknown data"); + } + } else { + switch (panelByte3) { + case 0x44: stream->print(F(" v3.14 | Supervision hours")); break; + } + } + } break; //section 804 verified on pc1832 and pc5020 + case 0x14: stream->print(F("RF5400")); { + if (panelByte4 == 0x82) { + stream->print(F(": subsection ")); + if (panelByte4 < 16) stream->print("0"); + stream->print(panelByte3, HEX); + } + } break; //section 801 not verified case 0x15: stream->print(F("RF5936")); break; //section 802 not verified case 0x16: stream->print(F("LINKS2X50")); break; //section 803 not verified case 0x17: stream->print(F("PC5108L")); break; //section 806 not verified case 0x19: stream->print(F("RF5100")); break; //section 805 not verified - case 0x31: stream->print(F("*5 user")); break; //*5 access codes verified on pc1832 and pc5020 - default: stream->print("Unknown data"); + case 0x31: { //*5 access codes verified on pc1832 and pc5020 + stream->print(F("*5 user code ")); + switch (panelByte3) { + case 0x01: + case 0x03: stream->print(F("17 ")); break; + case 0x04: + case 0x06: stream->print(F("18 ")); break; + case 0x07: + case 0x09: stream->print(F("19 ")); break; + case 0x0A: + case 0x0C: stream->print(F("20 ")); break; + case 0x0D: + case 0x0F: stream->print(F("21 ")); break; + case 0x10: + case 0x12: stream->print(F("22 ")); break; + case 0x13: + case 0x15: stream->print(F("23 ")); break; + case 0x16: + case 0x18: stream->print(F("24 ")); break; + case 0x19: + case 0x1B: stream->print(F("25 ")); break; + case 0x1C: + case 0x1E: stream->print(F("26 ")); break; + case 0x1F: + case 0x21: stream->print(F("27 ")); break; + case 0x22: + case 0x24: stream->print(F("28 ")); break; + case 0x25: + case 0x27: stream->print(F("29 ")); break; + case 0x28: + case 0x2A: stream->print(F("30 ")); break; + case 0x2B: + case 0x2D: stream->print(F("31 ")); break; + case 0x2E: + case 0x30: stream->print(F("32 ")); break; + default: stream->print("Unknown data "); + } + } break; //*5 access codes verified on pc1832 and pc5020 + default: stream->print("Unknown data "); + } + if (panelByte4 == 0x02) { + stream->print(F(" | ")); + for (byte panelByte = 5; panelByte <= 7; panelByte ++) { + stream->print(panelData[panelByte] >> 4, HEX); + stream->print(panelData[panelByte] & 0x0F, HEX); + } } - stream->print(" | "); - if (panelByte3 < 16) stream->print("0"); - stream->print(panelByte3, HEX); } From bb5f98e370c087ae27ee8f750accf7d851cb8e9e Mon Sep 17 00:00:00 2001 From: krikon <56011330+kricon@users.noreply.github.com> Date: Mon, 27 Jun 2022 00:55:15 +0200 Subject: [PATCH 2/9] Added PC5200 module status and Auto-Disarm msgs Decoded by Alviunta https://github.com/taligentx/dscKeybusInterface/issues/295 --- src/dscKeybusPrintData.cpp | 277 +++++++++++++++++++++++++++++++++++-- 1 file changed, 268 insertions(+), 9 deletions(-) diff --git a/src/dscKeybusPrintData.cpp b/src/dscKeybusPrintData.cpp index 3c599bb..9bd76c3 100644 --- a/src/dscKeybusPrintData.cpp +++ b/src/dscKeybusPrintData.cpp @@ -807,6 +807,8 @@ void dscKeybusInterface::printPanelStatus3(byte panelByte) { case 0x0A: stream->print(F("PC5204: Supervisory trouble")); return; case 0x17: stream->print(F("Zone expander restored: 7")); return; case 0x18: stream->print(F("Zone expander trouble: 7")); return; + // 0x1B - 0x1E: PC5200: Supervisory restored, slots 1-4 + // 0x1F - 0x22: PC5200: Supervisory trouble, slots 1-4 // 0x25 - 0x2C: Keypad tamper restored, slots 1-8 // 0x2D - 0x34: Keypad tamper, slots 1-8 // 0x35 - 0x3A: Module tamper restored, slots 9-14 @@ -819,6 +821,8 @@ void dscKeybusInterface::printPanelStatus3(byte panelByte) { case 0x46: stream->print(F("PC5204: Tamper")); return; case 0x51: stream->print(F("Zone expander tamper restored: 7")); return; case 0x52: stream->print(F("Zone expander tamper: 7")); return; + // 0x53 - 0x56: PC5200 Tamper restore, slots 1-4 + // 0x57 - 0x5A: PC5200 Tamper, slots 1-4 case 0xB3: stream->print(F("PC5204: Battery restored")); return; case 0xB4: stream->print(F("PC5204: Battery trouble")); return; case 0xB5: stream->print(F("PC5204: Aux supply restored")); return; @@ -837,6 +841,24 @@ void dscKeybusInterface::printPanelStatus3(byte panelByte) { return; } + /* + * PC5200 Supervisory restored: 1-4 + */ + if (panelData[panelByte] >= 0x1B && panelData[panelByte] <= 0x1E) { + stream->print(F("PC5200 Supervisory restored: ")); + printNumberOffset(panelByte, -0x1A); + return; + } + + /* + * PC5200 Supervisory trouble: 1-4 + */ + if (panelData[panelByte] >= 0x1F && panelData[panelByte] <= 0x22) { + stream->print(F("PC5200 Supervisory trouble: ")); + printNumberOffset(panelByte, -0x1E); + return; + } + /* * Keypad tamper restored: 1-8 */ @@ -885,6 +907,24 @@ void dscKeybusInterface::printPanelStatus3(byte panelByte) { return; } + /* + * PC5200 tamper restore: 1-4 + */ + if (panelData[panelByte] >= 0x53 && panelData[panelByte] <= 0x56) { + stream->print(F("PC5200: Tamper restore: ")); + printNumberOffset(panelByte, -0x52); + return; + } + + /* + * PC5200 tamper: 1-4 + */ + if (panelData[panelByte] >= 0x57 && panelData[panelByte] <= 0x5A) { + stream->print(F("PC5200: Tamper: ")); + printNumberOffset(panelByte, -0x56); + return; + } + stream->print("Unknown data"); } @@ -987,11 +1027,52 @@ void dscKeybusInterface::printPanelStatus5(byte panelByte) { void dscKeybusInterface::printPanelStatus14(byte panelByte) { #if !defined(__AVR__) // Excludes Arduino/AVR to conserve storage space switch (panelData[panelByte]) { + // 0xA0 - 0xA3: PC5200 AC restore, slots 1-4 + // 0xA4 - 0xA7: PC5200 AC trouble, slots 1-4 + // 0xA8 - 0xAB: PC5200 Battery restore, slots 1-4 + // 0xAC - 0xAF: PC5200 Battery trouble, slots 1-4 case 0xC0: stream->print(F("TLink com fault")); return; case 0xC2: stream->print(F("Tlink network fault")); return; case 0xC4: stream->print(F("TLink receiver trouble")); return; case 0xC5: stream->print(F("TLink receiver restored")); return; } + + /* + * PC5200 AC restore: 1-4 + */ + if (panelData[panelByte] >= 0xA0 && panelData[panelByte] <= 0xA3) { + stream->print(F("PC5200: AC restore: ")); + printNumberOffset(panelByte, -0x9F); + return; + } + + /* + * PC5200 AC trouble: 1-4 + */ + if (panelData[panelByte] >= 0xA4 && panelData[panelByte] <= 0xA7) { + stream->print(F("PC5200: AC trouble: ")); + printNumberOffset(panelByte, -0xA3); + return; + } + + /* + * PC5200 Battery restore: 1-4 + */ + if (panelData[panelByte] >= 0xA8 && panelData[panelByte] <= 0xAB) { + stream->print(F("PC5200: Battery restore: ")); + printNumberOffset(panelByte, -0xA7); + return; + } + + /* + * PC5200 Battery trouble: 1-4 + */ + if (panelData[panelByte] >= 0xAC && panelData[panelByte] <= 0xAF) { + stream->print(F("PC5200: Battery trouble: ")); + printNumberOffset(panelByte, -0xAB); + return; + } + #endif printUnknownData(); @@ -1012,6 +1093,7 @@ void dscKeybusInterface::printPanelStatus16(byte panelByte) { case 0x80: stream->print(F("Trouble acknowledged")); return; case 0x81: stream->print(F("RF delinquency trouble")); return; case 0x82: stream->print(F("RF delinquency restore")); return; + case 0x83: stream->print(F("Auto-Disarm")); return; } printUnknownData(); @@ -3076,7 +3158,9 @@ void dscKeybusInterface::printModule_Status() { * Byte 6 bit 6-7: PC5204 * Byte 7 bit 0-1: Zone expander 7 * Byte 7 bit 2-7: Unknown - * Byte 8: Unknown + * Byte 8 bit 4-5: PC5200 1 + * Byte 8 bit 2-3: PC5200 2 + * Byte 8 bit 0-1: PC5200 3 * * 00010001 0 10101010 10101010 10101010 10101010 10101010 10101010 10101010 [0x11] Module supervision query * @@ -3085,6 +3169,9 @@ void dscKeybusInterface::printModule_Status() { * 11111111 1 00111111 11111111 00001111 11110011 11111111 11111111 11111111 [Module/0x11] Keypad slots: 1 | Zone expander: 1 2 | PC/RF5132 * 11111111 1 00111111 11111111 11001111 11111111 11111111 11111100 11111111 [Module/0x11] Keypad slots: 1 | Zone expander: 2 7 * 11111111 1 11111111 11111100 00111111 11111111 00111111 11111111 11111111 [Module/0x11] Keypad slots: 8 | Zone expander: 1 | PC5204 + * 11111111 1 11111111 11111100 00000000 00001111 11111111 11111111 11001111 [Module/0x11] Keypad slots: 8 | Zone expander: 1 2 3 4 5 6 //PC5200 1 + * 11111111 1 11111111 11111100 00000000 00001111 11111111 11111111 11110011 [Module/0x11] Keypad slots: 8 | Zone expander: 1 2 3 4 5 6 //PC5200 2 + * 11111111 1 11111111 11111100 00000000 00001111 11111111 11111111 11111100 [Module/0x11] Keypad slots: 8 | Zone expander: 1 2 3 4 5 6 //PC5200 3 * Byte 0 1 2 3 4 5 6 7 8 */ void dscKeybusInterface::printModule_0x11() { @@ -3111,6 +3198,9 @@ void dscKeybusInterface::printModule_0x11() { if ((moduleData[5] & 0x0C) == 0) stream->print(F("| PC/RF5132 ")); if ((moduleData[5] & 0x03) == 0) stream->print(F("| PC5208 ")); if ((moduleData[6] & 0xC0) == 0) stream->print(F("| PC5204 ")); + if ((moduleData[8] & 0x30) == 0) stream->print(F("| PC5200 1 ")); + if ((moduleData[8] & 0x0C) == 0) stream->print(F("| PC5200 2 ")); + if ((moduleData[8] & 0x03) == 0) stream->print(F("| PC5200 3 ")); } @@ -3177,10 +3267,14 @@ void dscKeybusInterface::printModule_0x41() { * Byte 12: Unknown * * Later generation panels: - * Byte 13 bit 0-3: Unknown + * Byte 13 bit 0-1: PC5200 1 tamper restore + * Byte 13 bit 2-3: PC5200 1 tamper * Byte 13 bit 4-5: Module slot 16 tamper restore * Byte 13 bit 6-7: Module slot 16 tamper - * Byte 14: Unknown + * Byte 14 bit 0-1: PC5200 3 tamper restore + * Byte 14 bit 2-3: PC5200 3 tamper + * Byte 14 bit 4-5: PC5200 2 tamper restore + * Byte 14 bit 6-7: PC5200 2 tamper * * 11111111 1 11111111 11111111 11111110 11111111 [Module/0x05] Module tamper notification * 01001100 0 10101010 10101010 10101010 10101010 10101010 10101010 10101010 10101010 10101010 10101010 10101010 [0x4C] Module tamper query @@ -3218,6 +3312,13 @@ void dscKeybusInterface::printModule_0x41() { * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00111111 11111111 11111111 11111111 11111111 [Module/0x4C] PC5204: Tamper * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11001111 11111111 11111111 11111111 11111111 [Module/0x4C] PC5204: Tamper restored * 11111111 1 00001111 11111111 11111111 11111111 11111111 00001111 11111111 00110000 11111111 11111111 11111111 11111111 11111111 [Module/0x4C] Keypad tamper: Slot 1 | Module tamper: Slot 11 | RF5132: Tamper | PC5208: Tamper + * 11111111 1 11111111 11111111 11111111 11110000 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11110011 11111111 [Module/0x4C] Keypad tamper: Slot 8 //PC5200 1 tamper + * 11111111 1 11111111 11111111 11111111 11110000 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111100 11111111 [Module/0x4C] Keypad tamper: Slot 8 //PC5200 1 tamper restore + * 11111111 1 11111111 11111111 11111111 11110000 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00111111 [Module/0x4C] Keypad tamper: Slot 8 //PC5200 2 tamper + * 11111111 1 11111111 11111111 11111111 11110000 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11001111 [Module/0x4C] Keypad tamper: Slot 8 //PC5200 2 tamper restore + * 11111111 1 11111111 11111111 11111111 11110000 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11110011 [Module/0x4C] Keypad tamper: Slot 8 //PC5200 3 tamper + * 11111111 1 11111111 11111111 11111111 11110000 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111100 [Module/0x4C] Keypad tamper: Slot 8 //PC5200 3 tamper restore + * Byte 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 */ void dscKeybusInterface::printModule_0x4C() { @@ -3287,6 +3388,42 @@ void dscKeybusInterface::printModule_0x4C() { stream->print(F("PC5204: Tamper restored ")); printedMessage = true; } + + if ((moduleData[13] & 0x0C) == 0) { + if (printedMessage) stream->print("| "); + stream->print(F("PC5200 1: Tamper ")); + printedMessage = true; + } + + if ((moduleData[13] & 0x0F) == 0x0C) { + if (printedMessage) stream->print("| "); + stream->print(F("PC5200 1: Tamper restored ")); + printedMessage = true; + } + + if ((moduleData[14] & 0xC0) == 0) { + if (printedMessage) stream->print("| "); + stream->print(F("RF5200 2: Tamper ")); + printedMessage = true; + } + + if ((moduleData[14] & 0xF0) == 0xC0) { + if (printedMessage) stream->print("| "); + stream->print(F("RF5200 2: Tamper restored ")); + printedMessage = true; + } + + if ((moduleData[14] & 0x0C) == 0) { + if (printedMessage) stream->print("| "); + stream->print(F("PC5200 3: Tamper ")); + printedMessage = true; + } + + if ((moduleData[14] & 0x0F) == 0x0C) { + if (printedMessage) stream->print("| "); + stream->print(F("PC5200 3: Tamper restored ")); + printedMessage = true; + } } @@ -3352,13 +3489,25 @@ void dscKeybusInterface::printModule_0x57() { * Byte 5: Unknown * * Later generation panels: - * Byte 6: Unknown + * Byte 6 bit 0-1: PC5200 1 battery restore + * Byte 6 bit 2-3: PC5200 1 battery trouble + * Byte 6 bit 4-5: PC5200 1 AC power restore + * Byte 6 bit 6-7: PC5200 1 AC power trouble * Byte 7: Unknown - * Byte 8: Unknown + * Byte 8 bit 0-1: PC5200 2 battery restore + * Byte 8 bit 2-3: PC5200 2 battery trouble + * Byte 8 bit 4-5: PC5200 2 AC power restore + * Byte 8 bit 6-7: PC5200 2 AC power trouble * Byte 9: Unknown - * Byte 10: Unknown + * Byte 10 bit 0-1: PC5200 3 battery restore + * Byte 10 bit 2-3: PC5200 3 battery trouble + * Byte 10 bit 4-5: PC5200 3 AC power restore + * Byte 10 bit 6-7: PC5200 3 AC power trouble * Byte 11: Unknown - * Byte 12: Unknown + * Byte 12 bit 0-1: PC5200 4 battery restore + * Byte 12 bit 2-3: PC5200 4 battery trouble + * Byte 12 bit 4-5: PC5200 4 AC power restore + * Byte 12 bit 6-7: PC5200 4 AC power trouble * Byte 13: Unknown * * 11111111 1 11111111 11111111 11111111 11011111 [Module/0x05] Module status notification @@ -3374,6 +3523,24 @@ void dscKeybusInterface::printModule_0x57() { * * Module PC5204 * 11111111 1 00111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 [Module/0x58] PC5204: AC power trouble + * + * Module PC5200 Slot 1 Slot 2 Slot 3 Slot 4 + * 11111111 1 11111111 11111111 11111111 11111111 00111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 [Module/0x58] Unknown data //PC5200 1 AC Trouble + * 11111111 1 11111111 11111111 11111111 11111111 11001111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 [Module/0x58] Unknown data //PC5200 1 AC Restore + * 11111111 1 11111111 11111111 11111111 11111111 11110011 11111111 11111111 11111111 11111111 11111111 11111111 11111111 [Module/0x58] Unknown data //PC5200 1 Battery trouble + * 11111111 1 11111111 11111111 11111111 11111111 11111100 11111111 11111111 11111111 11111111 11111111 11111111 11111111 [Module/0x58] Unknown data //PC5200 1 Battery restore + * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 00111111 11111111 11111111 11111111 11111111 11111111 [Module/0x58] Unknown data //PC5200 2 AC Trouble + * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 11001111 11111111 11111111 11111111 11111111 11111111 [Module/0x58] Unknown data //PC5200 2 AC Restore + * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 11110011 11111111 11111111 11111111 11111111 11111111 [Module/0x58] Unknown data //PC5200 2 Battery trouble + * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 11111100 11111111 11111111 11111111 11111111 11111111 [Module/0x58] Unknown data //PC5200 2 Battery restore + * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00111111 11111111 11111111 11111111 [Module/0x58] Unknown data //PC5200 3 AC Trouble + * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11001111 11111111 11111111 11111111 [Module/0x58] Unknown data //PC5200 3 AC Restore + * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11110011 11111111 11111111 11111111 [Module/0x58] Unknown data //PC5200 3 Battery trouble + * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111100 11111111 11111111 11111111 [Module/0x58] Unknown data //PC5200 3 Battery restore + * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00111111 11111111 [Module/0x58] Unknown data //PC5200 4 AC Trouble + * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11001111 11111111 [Module/0x58] Unknown data //PC5200 4 AC Restore + * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11110011 11111111 [Module/0x58] Unknown data //PC5200 4 Battery trouble + * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111100 11111111 [Module/0x58] Unknown data //PC5200 4 Battery restore * Byte 0 1 2 3 4 5 6 7 8 9 10 11 12 13 */ void dscKeybusInterface::printModule_0x58() { @@ -3414,6 +3581,98 @@ void dscKeybusInterface::printModule_0x58() { printedMessage = true; } + if ((moduleData[6] & 0x03) == 0) { + stream->print(F("PC5200 1: Battery restored ")); + printedMessage = true; + } + + if ((moduleData[6] & 0x0C) == 0) { + if (printedMessage) stream->print("| "); + stream->print(F("PC5200 1: Battery trouble ")); + printedMessage = true; + } + + if ((moduleData[6] & 0x30) == 0) { + if (printedMessage) stream->print("| "); + stream->print(F("PC5200 1: AC power restored ")); + printedMessage = true; + } + + if ((moduleData[6] & 0xC0) == 0) { + if (printedMessage) stream->print("| "); + stream->print(F("PC5200 1: AC power trouble ")); + printedMessage = true; + } + + if ((moduleData[8] & 0x03) == 0) { + stream->print(F("PC5200 2: Battery restored ")); + printedMessage = true; + } + + if ((moduleData[8] & 0x0C) == 0) { + if (printedMessage) stream->print("| "); + stream->print(F("PC5200 2: Battery trouble ")); + printedMessage = true; + } + + if ((moduleData[8] & 0x30) == 0) { + if (printedMessage) stream->print("| "); + stream->print(F("PC5200 2: AC power restored ")); + printedMessage = true; + } + + if ((moduleData[8] & 0xC0) == 0) { + if (printedMessage) stream->print("| "); + stream->print(F("PC5200 2: AC power trouble ")); + printedMessage = true; + } + + if ((moduleData[10] & 0x03) == 0) { + stream->print(F("PC5200 3: Battery restored ")); + printedMessage = true; + } + + if ((moduleData[10] & 0x0C) == 0) { + if (printedMessage) stream->print("| "); + stream->print(F("PC5200 3: Battery trouble ")); + printedMessage = true; + } + + if ((moduleData[10] & 0x30) == 0) { + if (printedMessage) stream->print("| "); + stream->print(F("PC5200 3: AC power restored ")); + printedMessage = true; + } + + if ((moduleData[10] & 0xC0) == 0) { + if (printedMessage) stream->print("| "); + stream->print(F("PC5200 3: AC power trouble ")); + printedMessage = true; + } + + if ((moduleData[12] & 0x03) == 0) { + stream->print(F("PC5200 4: Battery restored ")); + printedMessage = true; + } + + if ((moduleData[12] & 0x0C) == 0) { + if (printedMessage) stream->print("| "); + stream->print(F("PC5200 4: Battery trouble ")); + printedMessage = true; + } + + if ((moduleData[12] & 0x30) == 0) { + if (printedMessage) stream->print("| "); + stream->print(F("PC5200 4: AC power restored ")); + printedMessage = true; + } + + if ((moduleData[12] & 0xC0) == 0) { + if (printedMessage) stream->print("| "); + stream->print(F("PC5200 4: AC power trouble ")); + printedMessage = true; + } + if (!printedMessage) printUnknownData(); } @@ -3463,7 +3722,7 @@ void dscKeybusInterface::printModule_0x70() { */ void dscKeybusInterface::printModule_0x94() { stream->print(F("Module pgm response: ")); - + for (byte moduleByte = 2; moduleByte <= 7; moduleByte ++) { stream->print(" | Byte"); stream->print(moduleByte); @@ -3782,7 +4041,7 @@ void dscKeybusInterface::printModuleProgramming(byte panelByte2, byte panelByte3 case 0x29: stream->print(F(" v5.x | Keyfob 14 ESN input")); break; case 0x2C: stream->print(F(" v5.x | Keyfob 15 ESN input")); break; case 0x2F: stream->print(F(" v5.x | Keyfob 16 ESN input")); break; - case 0x44: stream->print(F(" v5.x | Zone 1 ESN input")); break; + case 0x44: stream->print(F(" v5.x | Zone 1 ESN input")); break; case 0x45: stream->print(F(" v3.x | Zone 1 ESN input")); break; case 0x47: stream->print(F(" v5.x | Zone 2 ESN input")); break; case 0x48: stream->print(F(" v3.x | Zone 2 ESN input")); break; From e60c4621b678a2f624170ba9bed6a196bea2c659 Mon Sep 17 00:00:00 2001 From: kricon <56011330+kricon@users.noreply.github.com> Date: Tue, 28 Jun 2022 17:17:14 +0200 Subject: [PATCH 3/9] PC5200 1-4 AUX PTC protection trouble/restore Decoded by https://github.com/Alviunta in https://github.com/taligentx/dscKeybusInterface/issues/295 --- src/dscKeybusPrintData.cpp | 44 ++++++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/src/dscKeybusPrintData.cpp b/src/dscKeybusPrintData.cpp index 9bd76c3..b329dd0 100644 --- a/src/dscKeybusPrintData.cpp +++ b/src/dscKeybusPrintData.cpp @@ -1031,6 +1031,8 @@ void dscKeybusInterface::printPanelStatus14(byte panelByte) { // 0xA4 - 0xA7: PC5200 AC trouble, slots 1-4 // 0xA8 - 0xAB: PC5200 Battery restore, slots 1-4 // 0xAC - 0xAF: PC5200 Battery trouble, slots 1-4 + // 0xB0 - 0xB3: PC5200 AUX PTC restore, slots 1-4 + // 0xB4 - 0xB7: PC5200 AUX PTC trouble, slots 1-4 case 0xC0: stream->print(F("TLink com fault")); return; case 0xC2: stream->print(F("Tlink network fault")); return; case 0xC4: stream->print(F("TLink receiver trouble")); return; @@ -1072,6 +1074,24 @@ void dscKeybusInterface::printPanelStatus14(byte panelByte) { printNumberOffset(panelByte, -0xAB); return; } + + /* + * PC5200 ATX output PTC protection restore: 1-4 + */ + if (panelData[panelByte] >= 0xB0 && panelData[panelByte] <= 0xB3) { + stream->print(F("PC5200: AUX PTC restore: ")); + printNumberOffset(panelByte, -0xAF); + return; + } + + /* + * PC5200 AUX output PTC protection trouble: 1-4 + */ + if (panelData[panelByte] >= 0xB4 && panelData[panelByte] <= 0xB7) { + stream->print(F("PC5200: AUX PTC trouble: ")); + printNumberOffset(panelByte, -0xB3); + return; + } #endif @@ -3493,22 +3513,30 @@ void dscKeybusInterface::printModule_0x57() { * Byte 6 bit 2-3: PC5200 1 battery trouble * Byte 6 bit 4-5: PC5200 1 AC power restore * Byte 6 bit 6-7: PC5200 1 AC power trouble - * Byte 7: Unknown + * Byte 7 bit 0-3: Unknown + * Byte 7 bit 4-5: PC5200 1 AUX restore + * Byte 7 bit 6-7: PC5200 1 AUX trouble * Byte 8 bit 0-1: PC5200 2 battery restore * Byte 8 bit 2-3: PC5200 2 battery trouble * Byte 8 bit 4-5: PC5200 2 AC power restore * Byte 8 bit 6-7: PC5200 2 AC power trouble - * Byte 9: Unknown + * Byte 9 bit 0-3: Unknown + * Byte 9 bit 4-5: PC5200 2 AUX restore + * Byte 9 bit 6-7: PC5200 2 AUX trouble * Byte 10 bit 0-1: PC5200 3 battery restore * Byte 10 bit 2-3: PC5200 3 battery trouble * Byte 10 bit 4-5: PC5200 3 AC power restore * Byte 10 bit 6-7: PC5200 3 AC power trouble - * Byte 11: Unknown + * Byte 11 bit 0-3: Unknown + * Byte 11 bit 4-5: PC5200 3 AUX restore + * Byte 11 bit 6-7: PC5200 3 AUX trouble * Byte 12 bit 0-1: PC5200 4 battery restore * Byte 12 bit 2-3: PC5200 4 battery trouble * Byte 12 bit 4-5: PC5200 4 AC power restore * Byte 12 bit 6-7: PC5200 4 AC power trouble - * Byte 13: Unknown + * Byte 13 bit 0-3: Unknown + * Byte 13 bit 4-5: PC5200 4 AUX restore + * Byte 13 bit 6-7: PC5200 4 AUX trouble * * 11111111 1 11111111 11111111 11111111 11011111 [Module/0x05] Module status notification * 01011000 0 10101010 10101010 10101010 10101010 [0x58] Module status query @@ -3529,18 +3557,26 @@ void dscKeybusInterface::printModule_0x57() { * 11111111 1 11111111 11111111 11111111 11111111 11001111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 [Module/0x58] Unknown data //PC5200 1 AC Restore * 11111111 1 11111111 11111111 11111111 11111111 11110011 11111111 11111111 11111111 11111111 11111111 11111111 11111111 [Module/0x58] Unknown data //PC5200 1 Battery trouble * 11111111 1 11111111 11111111 11111111 11111111 11111100 11111111 11111111 11111111 11111111 11111111 11111111 11111111 [Module/0x58] Unknown data //PC5200 1 Battery restore + * 11111111 1 11111111 11111111 11111111 11111111 11111111 00111111 11111111 11111111 11111111 11111111 11111111 11111111 [Module/0x58] Unknown data //PC5200 1 AUX trouble + * 11111111 1 11111111 11111111 11111111 11111111 11111111 11001111 11111111 11111111 11111111 11111111 11111111 11111111 [Module/0x58] Unknown data //PC5200 1 AUX restore * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 00111111 11111111 11111111 11111111 11111111 11111111 [Module/0x58] Unknown data //PC5200 2 AC Trouble * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 11001111 11111111 11111111 11111111 11111111 11111111 [Module/0x58] Unknown data //PC5200 2 AC Restore * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 11110011 11111111 11111111 11111111 11111111 11111111 [Module/0x58] Unknown data //PC5200 2 Battery trouble * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 11111100 11111111 11111111 11111111 11111111 11111111 [Module/0x58] Unknown data //PC5200 2 Battery restore + * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00111111 11111111 11111111 11111111 11111111 [Module/0x58] Unknown data //PC5200 2 AUX trouble + * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11001111 11111111 11111111 11111111 11111111 [Module/0x58] Unknown data //PC5200 2 AUX restore * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00111111 11111111 11111111 11111111 [Module/0x58] Unknown data //PC5200 3 AC Trouble * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11001111 11111111 11111111 11111111 [Module/0x58] Unknown data //PC5200 3 AC Restore * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11110011 11111111 11111111 11111111 [Module/0x58] Unknown data //PC5200 3 Battery trouble * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111100 11111111 11111111 11111111 [Module/0x58] Unknown data //PC5200 3 Battery restore + * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00111111 11111111 11111111 [Module/0x58] Unknown data //PC5200 3 AUX trouble + * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11001111 11111111 11111111 [Module/0x58] Unknown data //PC5200 3 AUX restore * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00111111 11111111 [Module/0x58] Unknown data //PC5200 4 AC Trouble * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11001111 11111111 [Module/0x58] Unknown data //PC5200 4 AC Restore * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11110011 11111111 [Module/0x58] Unknown data //PC5200 4 Battery trouble * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111100 11111111 [Module/0x58] Unknown data //PC5200 4 Battery restore + * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00111111 [Module/0x58] Unknown data //PC5200 4 AUX trouble + * 11111111 1 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11001111 [Module/0x58] Unknown data //PC5200 4 AUX restore * Byte 0 1 2 3 4 5 6 7 8 9 10 11 12 13 */ void dscKeybusInterface::printModule_0x58() { From febdee5c23d41bc998d24cfdebb2a2937afc2d62 Mon Sep 17 00:00:00 2001 From: kricon <56011330+kricon@users.noreply.github.com> Date: Wed, 29 Jun 2022 18:21:52 +0200 Subject: [PATCH 4/9] Add status msg for zones 33-64 bypass and fault/restore Contributed by Alviunta (https://github.com/Alviunta) In https://github.com/taligentx/dscKeybusInterface/issues/295 --- src/dscKeybusPrintData.cpp | 45 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/dscKeybusPrintData.cpp b/src/dscKeybusPrintData.cpp index b329dd0..b9777dd 100644 --- a/src/dscKeybusPrintData.cpp +++ b/src/dscKeybusPrintData.cpp @@ -1027,6 +1027,9 @@ void dscKeybusInterface::printPanelStatus5(byte panelByte) { void dscKeybusInterface::printPanelStatus14(byte panelByte) { #if !defined(__AVR__) // Excludes Arduino/AVR to conserve storage space switch (panelData[panelByte]) { + // 0x40 - 0x5F: Zone fault restored, zones 33-64 + // 0x60 - 0x7F: Zone fault, zones 33-64 + // 0x80 - 0x9F: Zone bypassed, zones 33-64 // 0xA0 - 0xA3: PC5200 AC restore, slots 1-4 // 0xA4 - 0xA7: PC5200 AC trouble, slots 1-4 // 0xA8 - 0xAB: PC5200 Battery restore, slots 1-4 @@ -1039,6 +1042,48 @@ void dscKeybusInterface::printPanelStatus14(byte panelByte) { case 0xC5: stream->print(F("TLink receiver restored")); return; } + /* + * Zone fault restored, zones 33-64 + * + * Command Partition YYY1YYY2 MMMMDD DDDHHHHH MMMMMM Status CRC + * 11101011 0 00000000 00100001 00010110 11000000 00110100 00010100 01011111 11111111 10001000 [0xEB] 2021.05.22 00:13 | Zone fault restored: 64 + * 11101100 0 00000000 00100001 00010110 11000000 00110100 00010100 01011111 00001001 10010011 [0xEC] Event: 009 | 2021.05.22 00:13 | Zone fault restored: 64 + * Byte 0 1 2 3 4 5 6 7 8 9 10 + */ + if (panelData[panelByte] >= 0x40 && panelData[panelByte] <= 0x5F) { + stream->print(F("Zone fault restored: ")); + printNumberOffset(panelByte, -31); + return; + } + + /* + * Zone fault, zones 33-64 + * + * Command Partition YYY1YYY2 MMMMDD DDDHHHHH MMMMMM Status CRC + * 11101011 0 00000000 00100001 00010110 11000000 00100100 00010100 01111111 11111111 10011000 [0xEB] 2021.05.22 00:09 | Zone fault: 64 + * 11101100 0 00000000 00100001 00010110 11000000 00100100 00010100 01111111 00001011 10100101 [0xEC] Event: 011 | 2021.05.22 00:09 | Zone fault: 64 + * Byte 0 1 2 3 4 5 6 7 8 9 10 + */ + if (panelData[panelByte] >= 0x60 && panelData[panelByte] <= 0x7F) { + stream->print(F("Zone fault: ")); + printNumberOffset(panelByte, -63); + return; + } + + /* + * Zones bypassed, zones 33-64 + * + * Command Partition YYY1YYY2 MMMMDD DDDHHHHH MMMMMM Status CRC + * 11101011 0 00000001 00100001 00010110 11000000 00011000 00010100 10011111 00000000 10101110 [0xEB] 2021.05.22 00:06 | Partition 1 | Zone bypassed: 64 + * 11101100 0 00000001 00100001 00010110 11000000 00011000 00010100 10011111 00010011 11000010 [0xEC] Event: 019 | 2021.05.22 00:06 | Partition 1 | Zone bypassed: 64 + * Byte 0 1 2 3 4 5 6 7 8 9 10 + */ + if (panelData[panelByte] >= 0x80 && panelData[panelByte] <= 0x9F) { + stream->print(F("Zone bypassed: ")); + printNumberOffset(panelByte, -95); + return; + } + /* * PC5200 AC restore: 1-4 */ From ef22f963a04f47aeb2438b54f23321ef1290af8e Mon Sep 17 00:00:00 2001 From: kricon <56011330+kricon@users.noreply.github.com> Date: Fri, 1 Jul 2022 03:52:02 +0200 Subject: [PATCH 5/9] Implemented 0x8D cmd with RF5132 messages Following decoding in https://github.com/taligentx/dscKeybusInterface/issues/188 Separated 0x8D and 0x94 cmd, messages only for 0x8D Added checks for printing correct options/data/signal strenght etc Cmd 0x8D data omitted for AVR/Arduino to fit into memory Massively tested with RF5121 v3.14/two v5.0/v5.1 modules --- src/dscKeybus.h | 3 +- src/dscKeybusPrintData.cpp | 565 ++++++++++++++++++++++++------------- 2 files changed, 365 insertions(+), 203 deletions(-) diff --git a/src/dscKeybus.h b/src/dscKeybus.h index dac4bd7..22d43c8 100644 --- a/src/dscKeybus.h +++ b/src/dscKeybus.h @@ -102,6 +102,7 @@ class dscKeybusInterface { bool accessCodeChanged[dscPartitions]; bool accessCodePrompt; // True if the panel is requesting an access code bool decimalInput; // True if the panel is requesting 3 digit input (for 0x6E readout) + bool optionInput; // True if the panel is requesting input option 1-8 (for 0x8D cmd) bool trouble, troubleChanged; bool powerTrouble, powerChanged; bool batteryTrouble, batteryChanged; @@ -286,7 +287,7 @@ class dscKeybusInterface { void printModule_KeyCodes(byte keyByte); void printModule_Expander(); bool printModuleSlots(byte startCount, byte startByte, byte endByte, byte startMask, byte endMask, byte bitShift, byte matchValue, bool reverse = false); - void printModuleProgramming(byte panelByte2, byte panelByte3, byte panelByte4, byte panelByte5, byte panelByte6, byte panelByte7); + void printModuleSubsection(); bool validCRC(); void writeKeys(const char * writeKeysArray); diff --git a/src/dscKeybusPrintData.cpp b/src/dscKeybusPrintData.cpp index b9777dd..d21f140 100644 --- a/src/dscKeybusPrintData.cpp +++ b/src/dscKeybusPrintData.cpp @@ -288,11 +288,11 @@ void dscKeybusInterface::printPanelMessages(byte panelByte) { case 0xE7: stream->print(F("Input: 3 digits")); decimalInput = true; break; case 0xE8: stream->print(F("Input: 4 digits")); break; case 0xE9: stream->print(F("Input: 5 digits")); break; - case 0xEA: stream->print(F("Input HEX: 2 digits")); break; + case 0xEA: stream->print(F("Input HEX: 2 digits")); optionInput = false; break; case 0xEB: stream->print(F("Input HEX: 4 digits")); break; case 0xEC: stream->print(F("Input HEX: 6 digits")); break; case 0xED: stream->print(F("Input HEX: 32 digits")); break; - case 0xEE: stream->print(F("Input: 1 option per zone")); break; + case 0xEE: stream->print(F("Input: 1 option per zone")); optionInput = true; break; case 0xEF: stream->print(F("Module supervision field")); break; case 0xF0: stream->print(F("Function key 1")); break; case 0xF1: stream->print(F("Function key 2")); break; @@ -2069,11 +2069,346 @@ void dscKeybusInterface::printPanel_0x87() { * Byte 0 1 2 3 4 5 6 7 8 9 */ void dscKeybusInterface::printPanel_0x8D() { - #if !defined(__AVR__) - stream->print(F("Module pgm entry: ")); - printModuleProgramming(panelData[2], panelData[3], panelData[4], panelData[5], panelData[6], panelData[7]); - #else - stream->print(F("Module programming entry")); + stream->print(F("Module programming entry: ")); + #if !defined(__AVR__) // Excludes Arduino/AVR to conserve storage space + switch (panelData[2]) { + case 0x11: stream->print(F("RF5132 ")); { + if (panelData[6] == 0xFF && panelData[7] == 0xFF) { + switch (panelData[3]) { + case 0x01: stream->print(F("Zone 1-8 device supervision options")); optionInput = true; break; // v3 + case 0x02: stream->print(F("Zone 9-16 device supervision options")); optionInput = true; break; + case 0x03: stream->print(F("Zone 17-24 device supervision options")); optionInput = true; break; + case 0x04: stream->print(F("Zone 25-32 device supervision options")); optionInput = true; break; + case 0x05: stream->print(F("Wireless keys 1-8 partition assignment")); optionInput = true; break; + case 0x06: stream->print(F("Wireless keys 9-16 partition assignment")); optionInput = true; break; + case 0x07: stream->print(F("General options")); optionInput = true; break; + case 0x10: stream->print(F("Partition 1 Wireless key function 1")); break; + case 0x11: stream->print(F("Partition 1 Wireless key function 2")); break; + case 0x12: stream->print(F("Partition 1 Wireless key function 3")); break; + case 0x13: stream->print(F("Partition 1 Wireless key function 4")); break; + case 0x14: stream->print(F("Partition 2 Wireless key function 1")); break; + case 0x15: stream->print(F("Partition 2 Wireless key function 2")); break; + case 0x16: stream->print(F("Partition 2 Wireless key function 3")); break; + case 0x17: stream->print(F("Partition 2 Wireless key function 4")); break; + case 0x38: stream->print(F("Wireless supervisory window")); break; //v5 + case 0x39: stream->print(F("RF jamming zone")); break; + case 0x3A: stream->print(F("General options")); optionInput = true; break; + // case 0x40: PC5132 v3.14 section [804][80], default data is 30, nothing in manual about it + case 0x41: stream->print(F("Zone placement test over")); break; + case 0x43: stream->print(F("Location signal strenght is ")); break; + case 0x44: stream->print(F("Wireless supervisory window")); break; //v3.x + case 0xA4: stream->print(F("Partition 1/Keyfob 1 function key 1")); break; //v5.0 Partition function key, v5.1 Keyfob function key + case 0xA5: stream->print(F("Partition 1/Keyfob 1 function key 2")); break; + case 0xA6: stream->print(F("Partition 1/Keyfob 1 function key 3")); break; + case 0xA7: stream->print(F("Partition 1/Keyfob 1 function key 4")); break; + case 0xA8: stream->print(F("Partition 2/Keyfob 2 function key 1")); break; + case 0xA9: stream->print(F("Partition 2/Keyfob 2 function key 2")); break; + case 0xAA: stream->print(F("Partition 2/Keyfob 2 function key 3")); break; + case 0xAB: stream->print(F("Partition 2/Keyfob 2 function key 4")); break; + case 0xAC: stream->print(F("Partition 3/Keyfob 3 function key 1")); break; + case 0xAD: stream->print(F("Partition 3/Keyfob 3 function key 2")); break; + case 0xAE: stream->print(F("Partition 3/Keyfob 3 function key 3")); break; + case 0xAF: stream->print(F("Partition 3/Keyfob 3 function key 4")); break; + case 0xB0: stream->print(F("Partition 4/Keyfob 4 function key 1")); break; + case 0xB1: stream->print(F("Partition 4/Keyfob 4 function key 2")); break; + case 0xB2: stream->print(F("Partition 4/Keyfob 4 function key 3")); break; + case 0xB3: stream->print(F("Partition 4/Keyfob 4 function key 4")); break; + case 0xB4: stream->print(F("Partition 5/Keyfob 5 function key 1")); break; + case 0xB5: stream->print(F("Partition 5/Keyfob 5 function key 2")); break; + case 0xB6: stream->print(F("Partition 5/Keyfob 5 function key 3")); break; + case 0xB7: stream->print(F("Partition 5/Keyfob 5 function key 4")); break; + case 0xB8: stream->print(F("Partition 6/Keyfob 6 function key 1")); break; + case 0xB9: stream->print(F("Partition 6/Keyfob 6 function key 2")); break; + case 0xBA: stream->print(F("Partition 6/Keyfob 6 function key 3")); break; + case 0xBB: stream->print(F("Partition 6/Keyfob 6 function key 4")); break; + case 0xBC: stream->print(F("Partition 7/Keyfob 7 function key 1")); break; + case 0xBD: stream->print(F("Partition 7/Keyfob 7 function key 2")); break; + case 0xBE: stream->print(F("Partition 7/Keyfob 7 function key 3")); break; + case 0xBF: stream->print(F("Partition 7/Keyfob 7 function key 4")); break; + case 0xC0: stream->print(F("Partition 8/Keyfob 8 function key 1")); break; + case 0xC1: stream->print(F("Partition 8/Keyfob 8 function key 2")); break; + case 0xC2: stream->print(F("Partition 8/Keyfob 8 function key 3")); break; + case 0xC3: stream->print(F("Partition 8/Keyfob 8 function key 4")); break; + case 0xC4: stream->print(F("Partition assignment keyfob 1/Keyfob 9 function key 1")); break; //v5.0 partition assignment, v5.1 Keyfob function key + case 0xC5: stream->print(F("Partition assignment keyfob 2/Keyfob 9 function key 2")); break; + case 0xC6: stream->print(F("Partition assignment keyfob 3/Keyfob 9 function key 3")); break; + case 0xC7: stream->print(F("Partition assignment keyfob 4/Keyfob 9 function key 4")); break; + case 0xC8: stream->print(F("Partition assignment keyfob 5/Keyfob 10 function key 1")); break; + case 0xC9: stream->print(F("Partition assignment keyfob 6/Keyfob 10 function key 2")); break; + case 0xCA: stream->print(F("Partition assignment keyfob 7/Keyfob 10 function key 3")); break; + case 0xCB: stream->print(F("Partition assignment keyfob 8/Keyfob 10 function key 4")); break; + case 0xCC: stream->print(F("Partition assignment keyfob 9/Keyfob 11 function key 1")); break; + case 0xCD: stream->print(F("Partition assignment keyfob 10/Keyfob 11 function key 2")); break; + case 0xCE: stream->print(F("Partition assignment keyfob 11/Keyfob 11 function key 3")); break; + case 0xCF: stream->print(F("Partition assignment keyfob 12/Keyfob 11 function key 4")); break; + case 0xD0: stream->print(F("Partition assignment keyfob 13/Keyfob 12 function key 1")); break; + case 0xD1: stream->print(F("Partition assignment keyfob 14/Keyfob 12 function key 2")); break; + case 0xD2: stream->print(F("Partition assignment keyfob 15/Keyfob 12 function key 3")); break; + case 0xD3: stream->print(F("Partition assignment keyfob 16/Keyfob 12 function key 4")); break; + case 0xD4: if (optionInput) stream->print(F("Zone 1-8 supervision")); //v5.0 + else stream->print(F("Wireless key 13 function key 1")); break; //v5.1 + case 0xD5: if (optionInput) stream->print(F("Zone 9-16 supervision")); + else stream->print(F("Wireless key 13 function key 2")); break; + case 0xD6: if (optionInput) stream->print(F("Zone 17-24 supervision")); + else stream->print(F("Wireless key 13 function key 3")); break; + case 0xD7: if (optionInput) stream->print(F("Zone 25-32 supervision")); + else stream->print(F("Wireless key 13 function key 4")); break; + case 0xD8: stream->print(F("Wireless key 14 function key 1")); break; + case 0xD9: stream->print(F("Wireless key 14 function key 2")); break; + case 0xDA: stream->print(F("Wireless key 14 function key 3")); break; + case 0xDB: stream->print(F("Wireless key 14 function key 4")); break; + case 0xDC: stream->print(F("Wireless key 15 function key 1")); break; + case 0xDD: stream->print(F("Wireless key 15 function key 2")); break; + case 0xDE: stream->print(F("Wireless key 15 function key 3")); break; + case 0xDF: stream->print(F("Wireless key 15 function key 4")); break; + case 0xE0: stream->print(F("Wireless key 16 function key 1")); break; + case 0xE1: stream->print(F("Wireless key 16 function key 2")); break; + case 0xE2: stream->print(F("Wireless key 16 function key 3")); break; + case 0xE3: stream->print(F("Wireless key 16 function key 4")); break; + case 0xE4: stream->print(F("Wireless key 1 partition assignment")); break; + case 0xE5: stream->print(F("Wireless key 2 partition assignment")); break; + case 0xE6: stream->print(F("Wireless key 3 partition assignment")); break; + case 0xE7: stream->print(F("Wireless key 4 partition assignment")); break; + case 0xE8: stream->print(F("Wireless key 5 partition assignment")); break; + case 0xE9: stream->print(F("Wireless key 6 partition assignment")); break; + case 0xEA: stream->print(F("Wireless key 7 partition assignment")); break; + case 0xEB: stream->print(F("Wireless key 8 partition assignment")); break; + case 0xEC: stream->print(F("Wireless key 9 partition assignment")); break; + case 0xED: stream->print(F("Wireless key 10 partition assignment")); break; + case 0xEE: stream->print(F("Wireless key 11 partition assignment")); break; + case 0xEF: stream->print(F("Wireless key 12 partition assignment")); break; + case 0xF0: stream->print(F("Wireless key 13 partition assignment")); break; + case 0xF1: stream->print(F("Wireless key 14 partition assignment")); break; + case 0xF2: stream->print(F("Wireless key 15 partition assignment")); break; + case 0xF3: stream->print(F("Wireless key 16 partition assignment")); break; + case 0xF4: stream->print(F("Zone 1-8 device supervision options")); optionInput = true; break; + case 0xF5: stream->print(F("Zone 9-16 device supervision options")); optionInput = true; break; + case 0xF6: stream->print(F("Zone 17-24 device supervision options")); optionInput = true; break; + case 0xF7: stream->print(F("Zone 25-32 device supervision options")); optionInput = true; break; + default: stream->print("Unknown data"); + } + } else { + switch (panelData[3]) { + case 0x02: stream->print(F("Keyfob 1 ESN")); break; //v5 + case 0x05: stream->print(F("Keyfob 2 ESN")); break; + case 0x08: stream->print(F("Keyfob 3 ESN")); break; + case 0x0B: stream->print(F("Keyfob 4 ESN")); break; + case 0x0E: stream->print(F("Keyfob 5 ESN")); break; + case 0x11: stream->print(F("Keyfob 6 ESN")); break; + case 0x14: stream->print(F("Keyfob 7 ESN")); break; + case 0x17: stream->print(F("Keyfob 8 ESN")); break; + case 0x1A: stream->print(F("Keyfob 9 ESN")); break; + case 0x1D: stream->print(F("Keyfob 10 ESN")); break; + case 0x20: stream->print(F("Keyfob 11 ESN")); break; + case 0x23: stream->print(F("Keyfob 12 ESN")); break; + case 0x26: stream->print(F("Keyfob 13 ESN")); break; + case 0x29: stream->print(F("Keyfob 14 ESN")); break; + case 0x2C: stream->print(F("Keyfob 15 ESN")); break; + case 0x2F: stream->print(F("Keyfob 16 ESN")); break; + case 0x41: stream->print(F("Zone placement test")); break; + case 0x44: stream->print(F("Zone 1 ESN")); break; //v5 + case 0x45: stream->print(F("Zone 1 ESN")); break; //v3 + case 0x47: stream->print(F("Zone 2 ESN")); break; + case 0x48: stream->print(F("Zone 2 ESN")); break; + case 0x4A: stream->print(F("Zone 3 ESN")); break; + case 0x4B: stream->print(F("Zone 3 ESN")); break; + case 0x4D: stream->print(F("Zone 4 ESN")); break; + case 0x4E: stream->print(F("Zone 4 ESN")); break; + case 0x50: stream->print(F("Zone 5 ESN")); break; + case 0x51: stream->print(F("Zone 5 ESN")); break; + case 0x53: stream->print(F("Zone 6 ESN")); break; + case 0x54: stream->print(F("Zone 6 ESN")); break; + case 0x56: stream->print(F("Zone 7 ESN")); break; + case 0x57: stream->print(F("Zone 7 ESN")); break; + case 0x59: stream->print(F("Zone 8 ESN")); break; + case 0x5A: stream->print(F("Zone 8 ESN")); break; + case 0x5C: stream->print(F("Zone 9 ESN")); break; + case 0x5D: stream->print(F("Zone 9 ESN")); break; + case 0x5F: stream->print(F("Zone 10 ESN")); break; + case 0x60: stream->print(F("Zone 10 ESN")); break; + case 0x62: stream->print(F("Zone 11 ESN")); break; + case 0x63: stream->print(F("Zone 11 ESN")); break; + case 0x65: stream->print(F("Zone 12 ESN")); break; + case 0x66: stream->print(F("Zone 12 ESN")); break; + case 0x68: stream->print(F("Zone 13 ESN")); break; + case 0x69: stream->print(F("Zone 13 ESN")); break; + case 0x6B: stream->print(F("Zone 14 ESN")); break; + case 0x6C: stream->print(F("Zone 14 ESN")); break; + case 0x6E: stream->print(F("Zone 15 ESN")); break; + case 0x6F: stream->print(F("Zone 15 ESN")); break; + case 0x71: stream->print(F("Zone 16 ESN")); break; + case 0x72: stream->print(F("Zone 16 ESN")); break; + case 0x74: stream->print(F("Zone 17 ESN")); break; + case 0x75: stream->print(F("Zone 17 ESN")); break; + case 0x77: stream->print(F("Zone 18 ESN")); break; + case 0x78: stream->print(F("Zone 18 ESN")); break; + case 0x7A: stream->print(F("Zone 19 ESN")); break; + case 0x7B: stream->print(F("Zone 19 ESN")); break; + case 0x7D: stream->print(F("Zone 20 ESN")); break; + case 0x7E: stream->print(F("Zone 20 ESN")); break; + case 0x80: stream->print(F("Zone 21 ESN")); break; + case 0x81: stream->print(F("Zone 21 ESN")); break; + case 0x83: stream->print(F("Zone 22 ESN")); break; + case 0x84: stream->print(F("Zone 22 ESN")); break; + case 0x86: stream->print(F("Zone 23 ESN")); break; + case 0x87: stream->print(F("Zone 23 ESN")); break; + case 0x89: stream->print(F("Zone 24 ESN")); break; + case 0x8A: stream->print(F("Zone 24 ESN")); break; + case 0x8C: stream->print(F("Zone 25 ESN")); break; + case 0x8D: stream->print(F("Zone 25 ESN")); break; + case 0x8F: stream->print(F("Zone 26 ESN")); break; + case 0x90: stream->print(F("Zone 26 ESN")); break; + case 0x92: stream->print(F("Zone 27 ESN")); break; + case 0x93: stream->print(F("Zone 27 ESN")); break; + case 0x95: stream->print(F("Zone 28 ESN")); break; + case 0x96: stream->print(F("Zone 28 ESN")); break; + case 0x98: stream->print(F("Zone 29 ESN")); break; + case 0x99: stream->print(F("Zone 29 ESN")); break; + case 0x9B: stream->print(F("Zone 30 ESN")); break; + case 0x9C: stream->print(F("Zone 30 ESN")); break; + case 0x9E: stream->print(F("Zone 31 ESN")); break; + case 0x9F: stream->print(F("Zone 31 ESN")); break; + case 0xA1: stream->print(F("Zone 32 ESN")); break; + case 0xA2: stream->print(F("Zone 32 ESN")); break; //v3 + case 0xB1: stream->print(F("Keyfob 1 ESN")); break; + case 0xB4: stream->print(F("Keyfob 2 ESN")); break; + case 0xB7: stream->print(F("Keyfob 3 ESN")); break; + case 0xBA: stream->print(F("Keyfob 4 ESN")); break; + case 0xBD: stream->print(F("Keyfob 5 ESN")); break; + case 0xC0: stream->print(F("Keyfob 6 ESN")); break; + case 0xC3: stream->print(F("Keyfob 7 ESN")); break; + case 0xC6: stream->print(F("Keyfob 8 ESN")); break; + case 0xC9: stream->print(F("Keyfob 9 ESN")); break; + case 0xCC: stream->print(F("Keyfob 10 ESN")); break; + case 0xCF: stream->print(F("Keyfob 11 ESN")); break; + case 0xD2: stream->print(F("Keyfob 12 ESN")); break; + case 0xD5: stream->print(F("Keyfob 13 ESN")); break; + case 0xD8: stream->print(F("Keyfob 14 ESN")); break; + case 0xDB: stream->print(F("Keyfob 15 ESN")); break; + case 0xDE: stream->print(F("Keyfob 16 ESN")); break; + default: stream->print("Unknown data"); + } + } + } break; + case 0x14: stream->print(F("PC5400")); break; + case 0x15: stream->print(F("PC59XX")); break; + case 0x16: stream->print(F("LINKS2X50")); break; + case 0x17: stream->print(F("PC5108L")); break; + case 0x19: stream->print(F("PC5100")); break; + case 0x31: { + stream->print(F("*5 user code ")); + switch (panelData[3]) { + case 0x01: + case 0x03: stream->print(F("17")); break; + case 0x04: + case 0x06: stream->print(F("18")); break; + case 0x07: + case 0x09: stream->print(F("19")); break; + case 0x0A: + case 0x0C: stream->print(F("20")); break; + case 0x0D: + case 0x0F: stream->print(F("21")); break; + case 0x10: + case 0x12: stream->print(F("22")); break; + case 0x13: + case 0x15: stream->print(F("23")); break; + case 0x16: + case 0x18: stream->print(F("24")); break; + case 0x19: + case 0x1B: stream->print(F("25")); break; + case 0x1C: + case 0x1E: stream->print(F("26")); break; + case 0x1F: + case 0x21: stream->print(F("27")); break; + case 0x22: + case 0x24: stream->print(F("28")); break; + case 0x25: + case 0x27: stream->print(F("29")); break; + case 0x28: + case 0x2A: stream->print(F("30")); break; + case 0x2B: + case 0x2D: stream->print(F("31")); break; + case 0x2E: + case 0x30: stream->print(F("32")); break; + default: stream->print("Unknown data"); + } + } break; + default: stream->print("Unknown data"); + } + + if (panelData[3] == 0x41) { + if (panelData[6] == 0x55) { + stream->print(F(", activate device on zone: ")); + switch (panelData[5]) { + case 0x01: stream->print(F("1")); break; + case 0x03: stream->print(F("2")); break; + case 0x05: stream->print(F("3")); break; + case 0x07: stream->print(F("4")); break; + case 0x09: stream->print(F("5")); break; + case 0x0B: stream->print(F("6")); break; + case 0x0D: stream->print(F("7")); break; + case 0x0F: stream->print(F("8")); break; + case 0x11: stream->print(F("9")); break; + case 0x13: stream->print(F("10")); break; + case 0x15: stream->print(F("11")); break; + case 0x17: stream->print(F("12")); break; + case 0x19: stream->print(F("13")); break; + case 0x1B: stream->print(F("14")); break; + case 0x1D: stream->print(F("15")); break; + case 0x1F: stream->print(F("16")); break; + case 0x21: stream->print(F("17")); break; + case 0x23: stream->print(F("18")); break; + case 0x25: stream->print(F("19")); break; + case 0x27: stream->print(F("20")); break; + case 0x29: stream->print(F("21")); break; + case 0x2B: stream->print(F("22")); break; + case 0x2D: stream->print(F("23")); break; + case 0x2F: stream->print(F("24")); break; + case 0x31: stream->print(F("25")); break; + case 0x33: stream->print(F("26")); break; + case 0x35: stream->print(F("27")); break; + case 0x37: stream->print(F("28")); break; + case 0x39: stream->print(F("29")); break; + case 0x3B: stream->print(F("30")); break; + case 0x3D: stream->print(F("31")); break; + case 0x3F: stream->print(F("32")); break; + default: stream->print("Unknown data"); + } + } + } + + if (panelData[3] == 0x43) { + if (panelData[5] == 0x01) stream->print(F("good")); + else if (panelData[5] == 0x02) stream->print(F("fair")); + else if (panelData[5] == 0x04) stream->print(F("bad")); + else stream->print("Unknown data"); + } + + if (panelData[4] == 0x02) { + stream->print(F(" HEX data: ")); + for (byte panelByte = 5; panelByte <= 7; panelByte ++) { + stream->print(panelData[panelByte] >> 4, HEX); + stream->print(panelData[panelByte] & 0x0F, HEX); + } + } + + if (panelData[2] == 0x31 && panelData[4] == 0x00 && panelData[6] == 0xFF && panelData[7] == 0xFF) { + if (panelData[5] == 0xAA) stream->print(F(" removed")); + if (panelData[5] == 0x00) stream->print(F(" confirm")); + } + + if (panelData[2] != 0x31 && panelData[3] != 0x41 && panelData[3] != 0x43 && panelData[6] == 0xFF && panelData[7] == 0xFF) { + if (optionInput) { + optionInput = false; + stream->print(F(" Enabled: ")); + printPanelBitNumbers(5, 1); + } + else { + stream->print(F(" Data entered: ")); + stream->print(panelData[5] >> 4, HEX); + stream->print(panelData[5] & 0x0F, HEX); + } + } #endif } @@ -2101,12 +2436,16 @@ void dscKeybusInterface::printPanel_0x8D() { * Byte 0 1 2 3 4 5 6 7 8 9 10 */ void dscKeybusInterface::printPanel_0x94() { - #if !defined(__AVR__) - stream->print(F("Module pgm request: ")); - printModuleProgramming(panelData[2], panelData[3], panelData[4], panelData[5], panelData[6], panelData[7]); - #else - stream->print(F("Module programming request")); - #endif + stream->print(F("Module programming request: ")); + switch (panelData[2]) { + case 0x11: stream->print(F("RF5132")); printModuleSubsection(); break; + case 0x14: stream->print(F("RF5400")); printModuleSubsection(); break; + case 0x15: stream->print(F("PC59XX")); printModuleSubsection(); break; + case 0x16: stream->print(F("LINKS2X50")); printModuleSubsection(); break; + case 0x17: stream->print(F("PC5108L")); printModuleSubsection(); break; + case 0x19: stream->print(F("RF5100")); printModuleSubsection(); break; + default: stream->print("Unknown data"); + } } @@ -3223,9 +3562,9 @@ void dscKeybusInterface::printModule_Status() { * Byte 6 bit 6-7: PC5204 * Byte 7 bit 0-1: Zone expander 7 * Byte 7 bit 2-7: Unknown - * Byte 8 bit 4-5: PC5200 1 - * Byte 8 bit 2-3: PC5200 2 * Byte 8 bit 0-1: PC5200 3 + * Byte 8 bit 2-3: PC5200 2 + * Byte 8 bit 4-5: PC5200 1 * * 00010001 0 10101010 10101010 10101010 10101010 10101010 10101010 10101010 [0x11] Module supervision query * @@ -3802,21 +4141,7 @@ void dscKeybusInterface::printModule_0x70() { * Content decoding: *incomplete */ void dscKeybusInterface::printModule_0x94() { - stream->print(F("Module pgm response: ")); - - for (byte moduleByte = 2; moduleByte <= 7; moduleByte ++) { - stream->print(" | Byte"); - stream->print(moduleByte); - stream->print(": "); - if (moduleData[moduleByte] < 16) stream->print("0"); - stream->print(moduleData[moduleByte], HEX); - } - stream->print(" data: "); - for (byte moduleByte = 7; moduleByte <= 10; moduleByte ++) { - byte result = (moduleData[moduleByte] << 1) & (moduleData[moduleByte+1] & 0x80); - stream->print(result >> 4, HEX); - stream->print(result & 0x0F, HEX); - } + stream->print(F("Module programming response")); } @@ -4095,178 +4420,14 @@ bool dscKeybusInterface::printModuleSlots(byte outputNumber, byte startByte, byt } -// Print 0x8D and 0x94 section and command subsection data used for programming modules -void dscKeybusInterface::printModuleProgramming(byte panelByte2, byte panelByte3, byte panelByte4, byte panelByte5, byte panelByte6, byte panelByte7) { - switch (panelByte2) { - case 0x11: stream->print(F("RF5132")); { - if (panelByte4 == 0x82) { - stream->print(F(": subsection")); - if (panelByte4 < 16) stream->print("0"); - stream->print(panelByte3, HEX); - } - if (panelByte4 == 0x02) { - switch (panelByte3) { - case 0x02: stream->print(F(" v5.x | Keyfob 1 ESN input")); break; - case 0x05: stream->print(F(" v5.x | Keyfob 2 ESN input")); break; - case 0x08: stream->print(F(" v5.x | Keyfob 3 ESN input")); break; - case 0x0B: stream->print(F(" v5.x | Keyfob 4 ESN input")); break; - case 0x0E: stream->print(F(" v5.x | Keyfob 5 ESN input")); break; - case 0x11: stream->print(F(" v5.x | Keyfob 6 ESN input")); break; - case 0x14: stream->print(F(" v5.x | Keyfob 7 ESN input")); break; - case 0x17: stream->print(F(" v5.x | Keyfob 8 ESN input")); break; - case 0x1A: stream->print(F(" v5.x | Keyfob 9 ESN input")); break; - case 0x1D: stream->print(F(" v5.x | Keyfob 10 ESN input")); break; - case 0x20: stream->print(F(" v5.x | Keyfob 11 ESN input")); break; - case 0x23: stream->print(F(" v5.x | Keyfob 12 ESN input")); break; - case 0x26: stream->print(F(" v5.x | Keyfob 13 ESN input")); break; - case 0x29: stream->print(F(" v5.x | Keyfob 14 ESN input")); break; - case 0x2C: stream->print(F(" v5.x | Keyfob 15 ESN input")); break; - case 0x2F: stream->print(F(" v5.x | Keyfob 16 ESN input")); break; - case 0x44: stream->print(F(" v5.x | Zone 1 ESN input")); break; - case 0x45: stream->print(F(" v3.x | Zone 1 ESN input")); break; - case 0x47: stream->print(F(" v5.x | Zone 2 ESN input")); break; - case 0x48: stream->print(F(" v3.x | Zone 2 ESN input")); break; - case 0x4A: stream->print(F(" v5.x | Zone 3 ESN input")); break; - case 0x4B: stream->print(F(" v3.x | Zone 3 ESN input")); break; - case 0x4D: stream->print(F(" v5.x | Zone 4 ESN input")); break; - case 0x4E: stream->print(F(" v3.x | Zone 4 ESN input")); break; - case 0x50: stream->print(F(" v5.x | Zone 5 ESN input")); break; - case 0x51: stream->print(F(" v3.x | Zone 5 ESN input")); break; - case 0x53: stream->print(F(" v5.x | Zone 6 ESN input")); break; - case 0x54: stream->print(F(" v3.x | Zone 6 ESN input")); break; - case 0x56: stream->print(F(" v5.x | Zone 7 ESN input")); break; - case 0x57: stream->print(F(" v3.x | Zone 7 ESN input")); break; - case 0x59: stream->print(F(" v5.x | Zone 8 ESN input")); break; - case 0x5A: stream->print(F(" v3.x | Zone 8 ESN input")); break; - case 0x5C: stream->print(F(" v5.x | Zone 9 ESN input")); break; - case 0x5D: stream->print(F(" v3.x | Zone 9 ESN input")); break; - case 0x5F: stream->print(F(" v5.x | Zone 10 ESN input")); break; - case 0x60: stream->print(F(" v3.x | Zone 10 ESN input")); break; - case 0x62: stream->print(F(" v5.x | Zone 11 ESN input")); break; - case 0x63: stream->print(F(" v3.x | Zone 11 ESN input")); break; - case 0x65: stream->print(F(" v5.x | Zone 12 ESN input")); break; - case 0x66: stream->print(F(" v3.x | Zone 12 ESN input")); break; - case 0x68: stream->print(F(" v5.x | Zone 13 ESN input")); break; - case 0x69: stream->print(F(" v3.x | Zone 13 ESN input")); break; - case 0x6B: stream->print(F(" v5.x | Zone 14 ESN input")); break; - case 0x6C: stream->print(F(" v3.x | Zone 14 ESN input")); break; - case 0x6E: stream->print(F(" v5.x | Zone 15 ESN input")); break; - case 0x6F: stream->print(F(" v3.x | Zone 15 ESN input")); break; - case 0x71: stream->print(F(" v5.x | Zone 16 ESN input")); break; - case 0x72: stream->print(F(" v3.x | Zone 16 ESN input")); break; - case 0x74: stream->print(F(" v5.x | Zone 17 ESN input")); break; - case 0x75: stream->print(F(" v3.x | Zone 17 ESN input")); break; - case 0x77: stream->print(F(" v5.x | Zone 18 ESN input")); break; - case 0x78: stream->print(F(" v3.x | Zone 18 ESN input")); break; - case 0x7A: stream->print(F(" v5.x | Zone 19 ESN input")); break; - case 0x7B: stream->print(F(" v3.x | Zone 19 ESN input")); break; - case 0x7D: stream->print(F(" v5.x | Zone 20 ESN input")); break; - case 0x7E: stream->print(F(" v3.x | Zone 20 ESN input")); break; - case 0x80: stream->print(F(" v5.x | Zone 21 ESN input")); break; - case 0x81: stream->print(F(" v3.x | Zone 21 ESN input")); break; - case 0x83: stream->print(F(" v5.x | Zone 22 ESN input")); break; - case 0x84: stream->print(F(" v3.x | Zone 22 ESN input")); break; - case 0x86: stream->print(F(" v5.x | Zone 23 ESN input")); break; - case 0x87: stream->print(F(" v3.x | Zone 23 ESN input")); break; - case 0x89: stream->print(F(" v5.x | Zone 24 ESN input")); break; - case 0x8A: stream->print(F(" v3.x | Zone 24 ESN input")); break; - case 0x8C: stream->print(F(" v5.x | Zone 25 ESN input")); break; - case 0x8D: stream->print(F(" v3.x | Zone 25 ESN input")); break; - case 0x8F: stream->print(F(" v5.x | Zone 26 ESN input")); break; - case 0x90: stream->print(F(" v3.x | Zone 26 ESN input")); break; - case 0x92: stream->print(F(" v5.x | Zone 27 ESN input")); break; - case 0x93: stream->print(F(" v3.x | Zone 27 ESN input")); break; - case 0x95: stream->print(F(" v5.x | Zone 28 ESN input")); break; - case 0x96: stream->print(F(" v3.x | Zone 28 ESN input")); break; - case 0x98: stream->print(F(" v5.x | Zone 29 ESN input")); break; - case 0x99: stream->print(F(" v3.x | Zone 29 ESN input")); break; - case 0x9B: stream->print(F(" v5.x | Zone 30 ESN input")); break; - case 0x9C: stream->print(F(" v3.x | Zone 30 ESN input")); break; - case 0x9E: stream->print(F(" v5.x | Zone 31 ESN input")); break; - case 0x9F: stream->print(F(" v3.x | Zone 31 ESN input")); break; - case 0xA1: stream->print(F(" v5.x | Zone 32 ESN input")); break; - case 0xA2: stream->print(F(" v3.x | Zone 32 ESN input")); break; - case 0xB1: stream->print(F(" v3.x | Keyfob 1 ESN input")); break; - case 0xB4: stream->print(F(" v3.x | Keyfob 2 ESN input")); break; - case 0xB7: stream->print(F(" v3.x | Keyfob 3 ESN input")); break; - case 0xBA: stream->print(F(" v3.x | Keyfob 4 ESN input")); break; - case 0xBD: stream->print(F(" v3.x | Keyfob 5 ESN input")); break; - case 0xC0: stream->print(F(" v3.x | Keyfob 6 ESN input")); break; - case 0xC3: stream->print(F(" v3.x | Keyfob 7 ESN input")); break; - case 0xC6: stream->print(F(" v3.x | Keyfob 8 ESN input")); break; - case 0xC9: stream->print(F(" v3.x | Keyfob 9 ESN input")); break; - case 0xCC: stream->print(F(" v3.x | Keyfob 10 ESN input")); break; - case 0xCF: stream->print(F(" v3.x | Keyfob 11 ESN input")); break; - case 0xD2: stream->print(F(" v3.x | Keyfob 12 ESN input")); break; - case 0xD5: stream->print(F(" v3.x | Keyfob 13 ESN input")); break; - case 0xD8: stream->print(F(" v3.x | Keyfob 14 ESN input")); break; - case 0xDB: stream->print(F(" v3.x | Keyfob 15 ESN input")); break; - case 0xDE: stream->print(F(" v3.x | Keyfob 16 ESN input")); break; - default: stream->print(" Unknown data"); - } - } else { - switch (panelByte3) { - case 0x44: stream->print(F(" v3.14 | Supervision hours")); break; - } - } - } break; //section 804 verified on pc1832 and pc5020 - case 0x14: stream->print(F("RF5400")); { - if (panelByte4 == 0x82) { - stream->print(F(": subsection ")); - if (panelByte4 < 16) stream->print("0"); - stream->print(panelByte3, HEX); - } - } break; //section 801 not verified - case 0x15: stream->print(F("RF5936")); break; //section 802 not verified - case 0x16: stream->print(F("LINKS2X50")); break; //section 803 not verified - case 0x17: stream->print(F("PC5108L")); break; //section 806 not verified - case 0x19: stream->print(F("RF5100")); break; //section 805 not verified - case 0x31: { //*5 access codes verified on pc1832 and pc5020 - stream->print(F("*5 user code ")); - switch (panelByte3) { - case 0x01: - case 0x03: stream->print(F("17 ")); break; - case 0x04: - case 0x06: stream->print(F("18 ")); break; - case 0x07: - case 0x09: stream->print(F("19 ")); break; - case 0x0A: - case 0x0C: stream->print(F("20 ")); break; - case 0x0D: - case 0x0F: stream->print(F("21 ")); break; - case 0x10: - case 0x12: stream->print(F("22 ")); break; - case 0x13: - case 0x15: stream->print(F("23 ")); break; - case 0x16: - case 0x18: stream->print(F("24 ")); break; - case 0x19: - case 0x1B: stream->print(F("25 ")); break; - case 0x1C: - case 0x1E: stream->print(F("26 ")); break; - case 0x1F: - case 0x21: stream->print(F("27 ")); break; - case 0x22: - case 0x24: stream->print(F("28 ")); break; - case 0x25: - case 0x27: stream->print(F("29 ")); break; - case 0x28: - case 0x2A: stream->print(F("30 ")); break; - case 0x2B: - case 0x2D: stream->print(F("31 ")); break; - case 0x2E: - case 0x30: stream->print(F("32 ")); break; - default: stream->print("Unknown data "); - } - } break; //*5 access codes verified on pc1832 and pc5020 - default: stream->print("Unknown data "); - } - if (panelByte4 == 0x02) { - stream->print(F(" | ")); - for (byte panelByte = 5; panelByte <= 7; panelByte ++) { - stream->print(panelData[panelByte] >> 4, HEX); - stream->print(panelData[panelByte] & 0x0F, HEX); - } +/* + * Prints requested module subsection for programming on panel command 0x94 + */ +void dscKeybusInterface::printModuleSubsection() { + if (panelData[4] == 0x82) { + stream->print(F(": subsection ")); + if (panelData[3] < 16) stream->print("0"); + stream->print(panelData[3], HEX); } } From 51845744e167dd6bfb10d632b3120cbcc9748b02 Mon Sep 17 00:00:00 2001 From: kricon <56011330+kricon@users.noreply.github.com> Date: Fri, 1 Jul 2022 04:27:26 +0200 Subject: [PATCH 6/9] Fit code into new KeybusReader isolated structure Sketch fits into Arduino Uno memory size - using 31422 bytes --- src/dscKeybusReader.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dscKeybusReader.h b/src/dscKeybusReader.h index 3105bec..62620a1 100644 --- a/src/dscKeybusReader.h +++ b/src/dscKeybusReader.h @@ -83,6 +83,7 @@ class dscKeybusReaderInterface { bool statusChanged; // True after any status change bool keybusConnected, keybusChanged; // True if data is detected on the Keybus bool decimalInput; // True if the panel is requesting 3 digit input (for 0x6E readout) + bool optionInput; // True if the panel is requesting option input 1-8 (for 0x8D cmd) bool disabled[dscPartitions]; /* panelData[] and moduleData[] store panel and keypad/module data in an array: command [0], stop bit by itself [1], @@ -212,7 +213,7 @@ class dscKeybusReaderInterface { void printModule_KeyCodes(byte keyByte); void printModule_Expander(); bool printModuleSlots(byte startCount, byte startByte, byte endByte, byte startMask, byte endMask, byte bitShift, byte matchValue, bool reverse = false); - void printModuleProgramming(byte panelByte2, byte panelByte3); + void printModuleSubsection(); bool validCRC(); void writeKeys(const char * writeKeysArray); From 480f69446b11e0f80bdf6c079dc1450ce46f1d07 Mon Sep 17 00:00:00 2001 From: kricon <56011330+kricon@users.noreply.github.com> Date: Wed, 31 Aug 2022 19:56:00 +0200 Subject: [PATCH 7/9] Documentation added, improvements and fixes --- src/dscKeybusPrintData.cpp | 216 +++++++++++++++++++------------------ 1 file changed, 111 insertions(+), 105 deletions(-) diff --git a/src/dscKeybusPrintData.cpp b/src/dscKeybusPrintData.cpp index 00c9e01..81d7234 100644 --- a/src/dscKeybusPrintData.cpp +++ b/src/dscKeybusPrintData.cpp @@ -1,3 +1,4 @@ +/* /* DSC Keybus Interface @@ -1854,7 +1855,7 @@ void dscKeybusReaderInterface::printPanel_0x6E() { if (panelData[2] <= 0x09) stream->print("0"); stream->print(panelData[2], DEC); } - else { + else { for (byte panelByte = 2; panelByte <= 5; panelByte ++) { stream->print(panelData[panelByte] >> 4, HEX); stream->print(panelData[panelByte] & 0x0F, HEX); @@ -2011,19 +2012,23 @@ void dscKeybusReaderInterface::printPanel_0x87() { /* - * 0x8D: Module programming entry, User code programming key response, codes 17-32 + * 0x8D: After module programming entry and after user code 17-32 programming * Note: Wireless keys 1-16 are assigned to user codes 17-32 * CRC: yes * Structure decoding: *incomplete * Content decoding: *incomplete * - * Byte 2: Unknown - * Byte 3: Unknown - * Byte 4: Unknown - * Byte 5: Unknown - * Byte 6: Unknown - * Byte 7: Unknown - * Byte 8: Unknown + * Byte 2: Module which entered data + * Byte 3: Module section from which data is requested + * Byte 4: 0x01 when device placement test, 0x02 when HEX data is contained on bytes 5-7 + * Byte 5 bits 0-7: Options 1-8 + * Byte 5 bits 0-3: HEX Digit 2 + * Byte 5 bits 4-7: HEX Digit 1 + * Byte 6 bits 0-3: HEX Digit 4 + * Byte 6 bits 4-7: HEX Digit 3 + * Byte 7 bits 0-3: HEX Digit 6 + * Byte 7 bits 4-7: HEX Digit 5 + * Byte 8: Unknown, always 0xFF * Byte 9: CRC * * Command CRC @@ -2035,42 +2040,16 @@ void dscKeybusReaderInterface::printPanel_0x87() { * 10001101 0 00110001 00100101 00000000 00001001 11111111 11111111 11111111 11101001 [0x8D] User code programming key response // Code 29 Key 0 * 10001101 0 00110001 00100101 00000000 00000001 11111111 11111111 11111111 11100001 [0x8D] User code programming key response // Code 29 Key 1 * 10001101 0 00110001 00110000 00000000 00000000 11111111 11111111 11111111 11101011 [0x8D] User code programming key response // Message after 4th key entered - * 10001101 0 00010001 01000001 00000001 00000111 01010101 11111111 11111111 00111010 [0x8D] Wls programming key response // Before WLS zone 4 placement test - * 10001101 0 00010001 01000001 00000001 00001001 01010101 11111111 11111111 00111100 [0x8D] Wls programming key response // Before WLS zone 5 placement test - * 10001101 0 00010001 01000001 00000001 00001011 01010101 11111111 11111111 00111110 [0x8D] Wls programming key response // Before WLS zone 6 placement test - * 10001101 0 00010001 01000001 00000001 00001101 01010101 11111111 11111111 01000000 [0x8D] Wls programming key response // Before WLS zone 7 placement test - * 10001101 0 00010001 01000001 00000001 00100001 01010101 11111111 11111111 01010100 [0x8D] Wls programming key response // Before WLS zone 17 placement test - * 10001101 0 00010001 01000001 00000001 00111111 01010101 11111111 11111111 01110010 [0x8D] Wls programming key response // Before WLS zone 32 placement test - * 10001101 0 00010001 01000001 00000001 01111111 01010101 11111111 11111111 10110010 [0x8D] Wls programming key response // Before WLS zone 64 placement test - * 10001101 0 00010001 01000011 00000000 00000001 11111111 11111111 11111111 11011111 [0x8D] Wls programming key response // Location is good, same for all zones - * 10001101 0 00010001 01000001 00000001 11111111 11111111 11111111 11111111 11011100 [0x8D] Wls programming key response // Wireless zone is not-assigned - * 10001101 0 00010001 10100100 00000000 00000011 11111111 11111111 11111111 01000010 [0x8D] Wls programming key response // Enter 03 for [804][61] function 1 - * 10001101 0 00010001 10100101 00000000 00000100 11111111 11111111 11111111 01000100 [0x8D] Wls programming key response // Enter 04 for [804][61] function 2 - * 10001101 0 00010001 10100101 00000000 00000011 11111111 11111111 11111111 01000011 [0x8D] Wls programming key response // Enter 03 for [804][61] function 2 - * 10001101 0 00010001 10101000 00000000 00000011 11111111 11111111 11111111 01000110 [0x8D] Wls programming key response // Enter 03 for [804][62] function 1 - * 10001101 0 00010001 10101001 00000000 00000100 11111111 11111111 11111111 01001000 [0x8D] Wls programming key response // Enter 04 for [804][62] function 2 - * 10001101 0 00010001 11000000 00000000 00000011 11111111 11111111 11111111 01011110 [0x8D] Wls programming key response // Enter 03 for [804][68] function 1 - * 10001101 0 00010001 11000011 00000000 00110000 11111111 11111111 11111111 10001110 [0x8D] Wls programming key response // Enter 30 for [804][68] function 4 - * 10001101 0 00010001 00111000 00000000 00010000 11111111 11111111 11111111 11100011 [0x8D] Wls programming key response // Enter 10 for [804][81] Wls supervisory window - * 10001101 0 00010001 00111000 00000000 10010110 11111111 11111111 11111111 01101001 [0x8D] Wls programming key response // Enter 96 for [804][81] Wls supervisory window - * 10001101 0 00010001 11000100 00000000 00000001 11111111 11111111 11111111 01100000 [0x8D] Wls programming key response // Enter 01 for [804][69] Keyfob 1 partition assigment - * 10001101 0 00010001 11000101 00000000 00000001 11111111 11111111 11111111 01100001 [0x8D] Wls programming key response // Enter 01 for [804][69] Keyfob 2 partition assigment - * 10001101 0 00010001 11000110 00000000 00000010 11111111 11111111 11111111 01100011 [0x8D] Wls programming key response // Enter 02 for [804][69] Keyfob 3 partition assigment - * 10001101 0 00010001 11010100 00000000 11111111 11111111 11111111 11111111 01101110 [0x8D] Wls programming key response // All 1-8 enabled in [804][82] supervision options - * 10001101 0 00010001 11010100 00000000 11110000 11111111 11111111 11111111 01011111 [0x8D] Wls programming key response // 5-8 zones enabled in [804][82] supervisiory options - * 10001101 0 00010001 11010101 00000000 00001111 11111111 11111111 11111111 01111111 [0x8D] Wls programming key response // 1-4 zones enabled in [804][83] supervisiory options - * 10001101 0 00010001 11010111 00000000 01111111 11111111 11111111 11111111 11110001 [0x8D] Wls programming key response // 1-7 zones enabled in [804][85] supervisiory options - * 10001101 0 00010001 00111010 00000000 01000000 11111111 11111111 11111111 00010101 [0x8D] Wls programming key response // Only option 7 enabled in [804][90] options - * 10001101 0 00010001 00111001 00000000 00001000 11111111 11111111 11111111 11011100 [0x8D] Wls programming key response // Set RF jamming zone 08 in [804][93] subsection - * 10001101 0 00010001 00111001 00000000 00000111 11111111 11111111 11111111 11011011 [0x8D] Wls programming key response // Set RF jamming zone 07 in [804][93] subsection * Byte 0 1 2 3 4 5 6 7 8 9 */ void dscKeybusReaderInterface::printPanel_0x8D() { stream->print(F("Module programming entry: ")); #if !defined(__AVR__) // Excludes Arduino/AVR to conserve storage space switch (panelData[2]) { - case 0x11: stream->print(F("RF5132 ")); { - if (panelData[6] == 0xFF && panelData[7] == 0xFF) { + case 0x11: { + stream->print(F("RF5132")); + stream->print(" | "); + if (panelData[4] != 0x02 && panelData[6] == 0xFF && panelData[7] == 0xFF) { // Doesn't contain HEX data switch (panelData[3]) { case 0x01: stream->print(F("Zone 1-8 device supervision options")); optionInput = true; break; // v3 case 0x02: stream->print(F("Zone 9-16 device supervision options")); optionInput = true; break; @@ -2092,7 +2071,7 @@ void dscKeybusReaderInterface::printPanel_0x8D() { case 0x3A: stream->print(F("General options")); optionInput = true; break; // case 0x40: PC5132 v3.14 section [804][80], default data is 30, nothing in manual about it case 0x41: stream->print(F("Zone placement test over")); break; - case 0x43: stream->print(F("Location signal strenght is ")); break; + case 0x43: stream->print(F("Location signal strenght ")); break; case 0x44: stream->print(F("Wireless supervisory window")); break; //v3.x case 0xA4: stream->print(F("Partition 1/Keyfob 1 function key 1")); break; //v5.0 Partition function key, v5.1 Keyfob function key case 0xA5: stream->print(F("Partition 1/Keyfob 1 function key 2")); break; @@ -2142,14 +2121,22 @@ void dscKeybusReaderInterface::printPanel_0x8D() { case 0xD1: stream->print(F("Partition assignment keyfob 14/Keyfob 12 function key 2")); break; case 0xD2: stream->print(F("Partition assignment keyfob 15/Keyfob 12 function key 3")); break; case 0xD3: stream->print(F("Partition assignment keyfob 16/Keyfob 12 function key 4")); break; - case 0xD4: if (optionInput) stream->print(F("Zone 1-8 supervision")); //v5.0 - else stream->print(F("Wireless key 13 function key 1")); break; //v5.1 - case 0xD5: if (optionInput) stream->print(F("Zone 9-16 supervision")); - else stream->print(F("Wireless key 13 function key 2")); break; - case 0xD6: if (optionInput) stream->print(F("Zone 17-24 supervision")); - else stream->print(F("Wireless key 13 function key 3")); break; - case 0xD7: if (optionInput) stream->print(F("Zone 25-32 supervision")); - else stream->print(F("Wireless key 13 function key 4")); break; + case 0xD4: + if (optionInput) stream->print(F("Zone 1-8 supervision")); //v5.0 + else stream->print(F("Wireless key 13 function key 1")); //v5.1 + break; + case 0xD5: + if (optionInput) stream->print(F("Zone 9-16 supervision")); + else stream->print(F("Wireless key 13 function key 2")); + break; + case 0xD6: + if (optionInput) stream->print(F("Zone 17-24 supervision")); + else stream->print(F("Wireless key 13 function key 3")); + break; + case 0xD7: + if (optionInput) stream->print(F("Zone 25-32 supervision")); + else stream->print(F("Wireless key 13 function key 4")); + break; case 0xD8: stream->print(F("Wireless key 14 function key 1")); break; case 0xD9: stream->print(F("Wireless key 14 function key 2")); break; case 0xDA: stream->print(F("Wireless key 14 function key 3")); break; @@ -2184,7 +2171,8 @@ void dscKeybusReaderInterface::printPanel_0x8D() { case 0xF7: stream->print(F("Zone 25-32 device supervision options")); optionInput = true; break; default: stream->print("Unknown data"); } - } else { + } + else { // Bytes 5-7 contains HEX data switch (panelData[3]) { case 0x02: stream->print(F("Keyfob 1 ESN")); break; //v5 case 0x05: stream->print(F("Keyfob 2 ESN")); break; @@ -2286,7 +2274,8 @@ void dscKeybusReaderInterface::printPanel_0x8D() { default: stream->print("Unknown data"); } } - } break; + break; + } case 0x14: stream->print(F("PC5400")); break; case 0x15: stream->print(F("PC59XX")); break; case 0x16: stream->print(F("LINKS2X50")); break; @@ -2329,51 +2318,52 @@ void dscKeybusReaderInterface::printPanel_0x8D() { case 0x30: stream->print(F("32")); break; default: stream->print("Unknown data"); } - } break; + break; + } default: stream->print("Unknown data"); } - if (panelData[3] == 0x41) { - if (panelData[6] == 0x55) { - stream->print(F(", activate device on zone: ")); - switch (panelData[5]) { - case 0x01: stream->print(F("1")); break; - case 0x03: stream->print(F("2")); break; - case 0x05: stream->print(F("3")); break; - case 0x07: stream->print(F("4")); break; - case 0x09: stream->print(F("5")); break; - case 0x0B: stream->print(F("6")); break; - case 0x0D: stream->print(F("7")); break; - case 0x0F: stream->print(F("8")); break; - case 0x11: stream->print(F("9")); break; - case 0x13: stream->print(F("10")); break; - case 0x15: stream->print(F("11")); break; - case 0x17: stream->print(F("12")); break; - case 0x19: stream->print(F("13")); break; - case 0x1B: stream->print(F("14")); break; - case 0x1D: stream->print(F("15")); break; - case 0x1F: stream->print(F("16")); break; - case 0x21: stream->print(F("17")); break; - case 0x23: stream->print(F("18")); break; - case 0x25: stream->print(F("19")); break; - case 0x27: stream->print(F("20")); break; - case 0x29: stream->print(F("21")); break; - case 0x2B: stream->print(F("22")); break; - case 0x2D: stream->print(F("23")); break; - case 0x2F: stream->print(F("24")); break; - case 0x31: stream->print(F("25")); break; - case 0x33: stream->print(F("26")); break; - case 0x35: stream->print(F("27")); break; - case 0x37: stream->print(F("28")); break; - case 0x39: stream->print(F("29")); break; - case 0x3B: stream->print(F("30")); break; - case 0x3D: stream->print(F("31")); break; - case 0x3F: stream->print(F("32")); break; - default: stream->print("Unknown data"); - } - } + // Wireless device placement test + if (panelData[3] == 0x41 && panelData[4] == 0x01 && panelData[6] == 0x55) { + stream->print(F(", activate device on zone: ")); + switch (panelData[5]) { + case 0x01: stream->print(F("1")); break; + case 0x03: stream->print(F("2")); break; + case 0x05: stream->print(F("3")); break; + case 0x07: stream->print(F("4")); break; + case 0x09: stream->print(F("5")); break; + case 0x0B: stream->print(F("6")); break; + case 0x0D: stream->print(F("7")); break; + case 0x0F: stream->print(F("8")); break; + case 0x11: stream->print(F("9")); break; + case 0x13: stream->print(F("10")); break; + case 0x15: stream->print(F("11")); break; + case 0x17: stream->print(F("12")); break; + case 0x19: stream->print(F("13")); break; + case 0x1B: stream->print(F("14")); break; + case 0x1D: stream->print(F("15")); break; + case 0x1F: stream->print(F("16")); break; + case 0x21: stream->print(F("17")); break; + case 0x23: stream->print(F("18")); break; + case 0x25: stream->print(F("19")); break; + case 0x27: stream->print(F("20")); break; + case 0x29: stream->print(F("21")); break; + case 0x2B: stream->print(F("22")); break; + case 0x2D: stream->print(F("23")); break; + case 0x2F: stream->print(F("24")); break; + case 0x31: stream->print(F("25")); break; + case 0x33: stream->print(F("26")); break; + case 0x35: stream->print(F("27")); break; + case 0x37: stream->print(F("28")); break; + case 0x39: stream->print(F("29")); break; + case 0x3B: stream->print(F("30")); break; + case 0x3D: stream->print(F("31")); break; + case 0x3F: stream->print(F("32")); break; + default: stream->print("Unknown data"); + } } + // Wireless device signal strenght if (panelData[3] == 0x43) { if (panelData[5] == 0x01) stream->print(F("good")); else if (panelData[5] == 0x02) stream->print(F("fair")); @@ -2382,26 +2372,31 @@ void dscKeybusReaderInterface::printPanel_0x8D() { } if (panelData[4] == 0x02) { - stream->print(F(" HEX data: ")); + stream->print(" | "); + stream->print(F("HEX data: ")); + for (byte panelByte = 5; panelByte <= 7; panelByte ++) { stream->print(panelData[panelByte] >> 4, HEX); stream->print(panelData[panelByte] & 0x0F, HEX); } } + // After exiting user access code 17-32 programming if (panelData[2] == 0x31 && panelData[4] == 0x00 && panelData[6] == 0xFF && panelData[7] == 0xFF) { if (panelData[5] == 0xAA) stream->print(F(" removed")); - if (panelData[5] == 0x00) stream->print(F(" confirm")); + if (panelData[5] == 0x00) stream->print(F(" submit")); } if (panelData[2] != 0x31 && panelData[3] != 0x41 && panelData[3] != 0x43 && panelData[6] == 0xFF && panelData[7] == 0xFF) { if (optionInput) { optionInput = false; - stream->print(F(" Enabled: ")); + stream->print(" | "); + stream->print(F("Enabled: ")); printPanelBitNumbers(5, 1); } else { - stream->print(F(" Data entered: ")); + stream->print(" | "); + stream->print(F("Data entered: ")); stream->print(panelData[5] >> 4, HEX); stream->print(panelData[5] & 0x0F, HEX); } @@ -2417,15 +2412,20 @@ void dscKeybusReaderInterface::printPanel_0x8D() { * Structure decoding: *incomplete * Content decoding: *incomplete * - * Byte 2: Unknown - * Byte 3: Unknown - * Byte 4: Unknown - * Byte 5: Unknown + * Byte 2: Always 0x11 when panel send, 0xFF when module send data + * Byte 3: Module subsection from which data is requested + * Byte 4: Always 0x82 when Byte3 contains requested module subsection to be accesed + * Byte 5: Always 0xA5 when entering *5 access code programming * Byte 6: Unknown - * Byte 7: Unknown - * Byte 8: Unknown - * Byte 9: Unknown - * Byte 10: CRC + * Byte 7 bit 0-6: Option 2-8 + * Byte 7 bit 3-6: Digit 1 + * Byte 7 bit 0-2 and Byte 8 bit 7: Digit 2 + * Byte 8 bit 7: Option 1 + * Byte 8 bit 3-6: Digit 3 + * Byte 8 bit 0-2 and Byte 9 bit 7: Digit 4 + * Byte 9 bit 3-6: Digit 5 + * Byte 9 bit 0-2 and Byte 10 bit 7: Digit 6 + * Byte 10 bits 0-6: CRC (?) * * Command CRC * 10010100 0 00010001 00000000 00000000 10100101 00000000 00000000 00000000 00010111 10100000 [0x94] Unknown data @@ -2435,7 +2435,12 @@ void dscKeybusReaderInterface::printPanel_0x8D() { void dscKeybusReaderInterface::printPanel_0x94() { stream->print(F("Module programming request: ")); switch (panelData[2]) { - case 0x11: stream->print(F("RF5132")); printModuleSubsection(); break; + case 0x11: { + if (panelData[5] == 0xA5) stream->print(F("*5 access codes")); + else stream->print(F("RF5132")); + printModuleSubsection(); + break; + } case 0x14: stream->print(F("RF5400")); printModuleSubsection(); break; case 0x15: stream->print(F("PC59XX")); printModuleSubsection(); break; case 0x16: stream->print(F("LINKS2X50")); printModuleSubsection(); break; @@ -4422,9 +4427,10 @@ bool dscKeybusReaderInterface::printModuleSlots(byte outputNumber, byte startByt */ void dscKeybusReaderInterface::printModuleSubsection() { if (panelData[4] == 0x82) { - stream->print(F(": subsection ")); + stream->print(" | "); + stream->print(F("Subsection: ")); if (panelData[3] < 16) stream->print("0"); - stream->print(panelData[3], HEX); + stream->print(panelData[3], HEX); } } From 8b07d95abfa70f3c58c4ebbcab511fda9c97a1a7 Mon Sep 17 00:00:00 2001 From: kricon <56011330+kricon@users.noreply.github.com> Date: Wed, 31 Aug 2022 19:59:08 +0200 Subject: [PATCH 8/9] Typo --- src/dscKeybusPrintData.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/dscKeybusPrintData.cpp b/src/dscKeybusPrintData.cpp index 81d7234..9520ab2 100644 --- a/src/dscKeybusPrintData.cpp +++ b/src/dscKeybusPrintData.cpp @@ -1,4 +1,3 @@ -/* /* DSC Keybus Interface From 9128e8db94df224b38dd8c7f13b1b9b71361c764 Mon Sep 17 00:00:00 2001 From: kricon <56011330+kricon@users.noreply.github.com> Date: Wed, 31 Aug 2022 20:36:33 +0200 Subject: [PATCH 9/9] Merged consecutive strings to improve memory usage --- src/dscKeybusPrintData.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/dscKeybusPrintData.cpp b/src/dscKeybusPrintData.cpp index 9520ab2..bf7d68f 100644 --- a/src/dscKeybusPrintData.cpp +++ b/src/dscKeybusPrintData.cpp @@ -2046,8 +2046,7 @@ void dscKeybusReaderInterface::printPanel_0x8D() { #if !defined(__AVR__) // Excludes Arduino/AVR to conserve storage space switch (panelData[2]) { case 0x11: { - stream->print(F("RF5132")); - stream->print(" | "); + stream->print(F("RF5132 | ")); if (panelData[4] != 0x02 && panelData[6] == 0xFF && panelData[7] == 0xFF) { // Doesn't contain HEX data switch (panelData[3]) { case 0x01: stream->print(F("Zone 1-8 device supervision options")); optionInput = true; break; // v3 @@ -2371,8 +2370,7 @@ void dscKeybusReaderInterface::printPanel_0x8D() { } if (panelData[4] == 0x02) { - stream->print(" | "); - stream->print(F("HEX data: ")); + stream->print(F(" | HEX data: ")); for (byte panelByte = 5; panelByte <= 7; panelByte ++) { stream->print(panelData[panelByte] >> 4, HEX); @@ -2389,13 +2387,11 @@ void dscKeybusReaderInterface::printPanel_0x8D() { if (panelData[2] != 0x31 && panelData[3] != 0x41 && panelData[3] != 0x43 && panelData[6] == 0xFF && panelData[7] == 0xFF) { if (optionInput) { optionInput = false; - stream->print(" | "); - stream->print(F("Enabled: ")); + stream->print(F(" | Enabled: ")); printPanelBitNumbers(5, 1); } else { - stream->print(" | "); - stream->print(F("Data entered: ")); + stream->print(F(" | Data entered: ")); stream->print(panelData[5] >> 4, HEX); stream->print(panelData[5] & 0x0F, HEX); } @@ -3808,13 +3804,13 @@ void dscKeybusReaderInterface::printModule_0x4C() { if ((moduleData[14] & 0xC0) == 0) { if (printedMessage) stream->print("| "); - stream->print(F("RF5200 2: Tamper ")); + stream->print(F("PC5200 2: Tamper ")); printedMessage = true; } if ((moduleData[14] & 0xF0) == 0xC0) { if (printedMessage) stream->print("| "); - stream->print(F("RF5200 2: Tamper restored ")); + stream->print(F("PC5200 2: Tamper restored ")); printedMessage = true; } @@ -4426,8 +4422,7 @@ bool dscKeybusReaderInterface::printModuleSlots(byte outputNumber, byte startByt */ void dscKeybusReaderInterface::printModuleSubsection() { if (panelData[4] == 0x82) { - stream->print(" | "); - stream->print(F("Subsection: ")); + stream->print(F(" | Subsection: ")); if (panelData[3] < 16) stream->print("0"); stream->print(panelData[3], HEX); }