-
Notifications
You must be signed in to change notification settings - Fork 136
/
Copy pathdscKeybusPrintData.cpp
4038 lines (3656 loc) · 172 KB
/
dscKeybusPrintData.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
DSC Keybus Interface
Functions used by the KeybusReader sketch to decode and print Keybus data, with
documentation of each message - including portions that are currently undecoded
and unknown. Contributions to improve decoding are always welcome!
https://github.com/taligentx/dscKeybusInterface
panelData[] and moduleData[] store panel and keypad/module data in an array: command [0], stop bit by itself [1],
followed by the remaining data.
panelData[] example:
Byte 0 Byte 2 Byte 3 Byte 4 Byte 5
00000101 0 10000001 00000001 10010001 11000111 [0x05] Partition 1: Ready Backlight - Partition ready | Partition 2: disabled
^Byte 1 (stop bit) ^Bit 7 ^Bit 0
This library is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "dscKeybus.h"
/*
* printPanelMessage() checks the first byte of a message from the
* panel (panelData[0]) to process known commands.
*
* Structure decoding status refers to whether all bits of the message have
* a known purpose.
*
* Content decoding status refers to whether all values of the message are known.
*/
void dscKeybusInterface::printPanelMessage() {
// Checks for errors on panel commands with CRC data
switch (panelData[0]) {
case 0x05: // Skips panel commands without CRC data
case 0x11:
case 0x1B:
case 0x1C:
case 0x22:
case 0x28:
case 0x33:
case 0x39:
case 0x41:
case 0x4C:
case 0x57:
case 0x58:
case 0x70:
case 0x94:
case 0x9E:
case 0xD5:
case 0xE6: break; // 0xE6 is checked separately as only some of its subcommands use CRC
default: { // Checks remaining panel commands
if (!validCRC()) {
stream->print(F("[CRC Error]"));
return;
}
}
}
// Processes known panel commands from the first byte of the panel message: panelData[0]
switch (panelData[0]) {
case 0x05: printPanel_0x05(); return; // Panel status: partitions 1-4 | Structure: complete | Content: *incomplete
case 0x0A:
case 0x0F: printPanel_0x0A_0F(); return; // Panel status in alarm/programming, partitions 1-2 | Structure: complete | Content: *incomplete
case 0x11: printPanel_0x11(); return; // Module supervision query | Structure: complete | Content: complete
case 0x16: printPanel_0x16(); return; // Panel configuration | Structure: *incomplete | Content: *incomplete
case 0x1B: printPanel_0x1B(); return; // Panel status: partitions 5-8 | Structure: complete | Content: *incomplete
case 0x1C: printPanel_0x1C(); return; // Verify keypad Fire/Auxiliary/Panic | Structure: complete | Content: complete
case 0x22:
case 0x28:
case 0x33:
case 0x39: printPanel_0x22_28_33_39(); return; // Zone expanders 0-3 query | Structure: complete | Content: complete
case 0x27: printPanel_0x27(); return; // Panel status and zones 1-8 status | Structure: complete | Content: *incomplete
case 0x2D: printPanel_0x2D(); return; // Panel status and zones 9-16 status | Structure: complete | Content: *incomplete
case 0x34: printPanel_0x34(); return; // Panel status and zones 17-24 status | Structure: complete | Content: *incomplete
case 0x3E: printPanel_0x3E(); return; // Panel status and zones 25-32 status | Structure: complete | Content: *incomplete
case 0x41: printPanel_0x41(); return; // Wireless module query | Structure: complete | Content: complete
case 0x4C: printPanel_0x4C(); return; // Module tamper query | Structure: complete | Content: *incomplete
case 0x57: printPanel_0x57(); return; // Wireless key query | Structure: complete | Content: *incomplete
case 0x58: printPanel_0x58(); return; // Module status query | Structure: complete | Content: *incomplete
case 0x5D:
case 0x63: printPanel_0x5D_63(); return; // Flash panel lights: status and zones 1-32, partitions 1-2 | Structure: complete | Content: complete
case 0x64: printPanel_0x64(); return; // Beep, partition 1 | Structure: complete | Content: complete
case 0x69: printPanel_0x69(); return; // Beep, partition 2 | Structure: complete | Content: complete
case 0x6E: printPanel_0x6E(); return; // LCD keypad display | Structure: complete | Content: complete
case 0x70: printPanel_0x70(); return; // LCD keypad data query | Structure: complete | Content: complete
case 0x75: printPanel_0x75(); return; // Tone, partition 1 | Structure: complete | Content: complete
case 0x7A: printPanel_0x7A(); return; // Tone, partition 2 | Structure: complete | Content: complete
case 0x7F: printPanel_0x7F(); return; // Buzzer, partition 1 | Structure: complete | Content: complete
case 0x82: printPanel_0x82(); return; // Buzzer, partition 2 | Structure: complete | Content: complete
case 0x87: printPanel_0x87(); return; // PGM outputs | Structure: complete | Content: complete
case 0x8D: printPanel_0x8D(); return; // RF module programming - it sends data from panel to RF module after programming entry is done | Structure: *incomplete | Content: *incomplete
case 0x94: printPanel_0x94(); return; // Requesting and getting data from RF module to the panel | Structure: *incomplete | Content: *incomplete
case 0x9E: printPanel_0x9E(); return; // DLS query | Structure: complete | Content: complete
case 0xA5: printPanel_0xA5(); return; // Date, time, system status messages - partitions 1-2 | Structure: *incomplete | Content: *incomplete
case 0xAA: printPanel_0xAA(); return; // Event buffer messages | Structure: complete | Content: *incomplete
case 0xB1: printPanel_0xB1(); return; // Enabled zones 1-32 | Structure: complete | Content: complete
case 0xBB: printPanel_0xBB(); return; // Bell | Structure: *incomplete | Content: *incomplete
case 0xC3: printPanel_0xC3(); return; // Keypad and dialer status | Structure: *incomplete | Content: *incomplete
case 0xCE: printPanel_0xCE(); return; // Panel status | Structure: *incomplete | Content: *incomplete
case 0xD5: printPanel_0xD5(); return; // Keypad zone query | Structure: complete | Content: complete
case 0xE6: printPanel_0xE6(); return; // Extended status command split into multiple subcommands to handle up to 8 partitions/64 zones | Structure: *incomplete | Content: *incomplete
case 0xEB: printPanel_0xEB(); return; // Date, time, system status messages - partitions 1-8 | Structure: *incomplete | Content: *incomplete
case 0xEC: printPanel_0xEC(); return; // Event buffer messages | Structure: *incomplete | Content: *incomplete
default: {
stream->print("Unknown data");
return;
}
}
}
// Processes keypad and module notifications and responses to panel queries
void dscKeybusInterface::printModuleMessage() {
switch (moduleData[0]) {
case 0xBB: printModule_0xBB(); return; // Keypad fire alarm | Structure: complete | Content: complete
case 0xDD: printModule_0xDD(); return; // Keypad auxiliary alarm | Structure: complete | Content: complete
case 0xEE: printModule_0xEE(); return; // Keypad panic alarm | Structure: complete | Content: complete
}
stream->print(F("[Module/0x"));
if (moduleCmd < 16) stream->print("0");
stream->print(moduleCmd, HEX);
if (moduleCmd == 0xE6) {
stream->print(".");
if (moduleSubCmd < 16) stream->print("0");
stream->print(moduleSubCmd, HEX);
}
stream->print(F("] "));
// Keypad and module responses to panel queries
switch (moduleCmd) {
case 0x05:
case 0x0A:
case 0x0F:
case 0x1B:
case 0x27:
case 0x2D:
case 0x3E: printModule_Status(); return; // Module notifications sent during panel status commands | Structure: *incomplete | Content: *incomplete
case 0x11: printModule_0x11(); return; // Module supervision query response | Structure: *incomplete | Content: *incomplete
case 0x41: printModule_0x41(); return; // Wireless module query response | Structure: *incomplete | Content: *incomplete
case 0x4C: printModule_0x4C(); return; // Module tamper query response | Structure: *incomplete | Content: *incomplete
case 0x57: printModule_0x57(); return; // Wireless key query response | Structure: *incomplete | Content: *incomplete
case 0x58: printModule_0x58(); return; // Module status query response | Structure: *incomplete | Content: *incomplete
case 0x70: printModule_0x70(); return; // LCD keypad data entry | Structure: complete | Content: complete
case 0x94: printModule_0x94(); return; // Module programming response | Structure: *incomplete | Content: *incomplete
case 0xD5: printModule_0xD5(); return; // Keypad zone query response | Structure: *incomplete | Content: *incomplete
case 0x22:
case 0x28:
case 0x33:
case 0x39: printModule_Expander(); return; // Zone expanders 1-3 response
case 0xE6: {
switch (moduleSubCmd) {
case 0x01:
case 0x02:
case 0x03:
case 0x04:
case 0x05:
case 0x06:
case 0x20:
case 0x21: printModule_Status(); return; // Module notifications sent during installer programming
case 0x08:
case 0x0A:
case 0x0C:
case 0x0E: printModule_Expander(); return; // Zone expanders 4-7 response
}
}
default: stream->print("Unknown data");
}
}
/*
* Keypad status lights for panel commands: 0x05, 0x0A, 0x1B, 0x27, 0x2D, 0x34, 0x3E, 0x5D
* Structure decoding: complete
* Content decoding: complete
*
* This decodes the following byte as a status message by default.
*/
void dscKeybusInterface::printPanelLights(byte panelByte, bool printMessage) {
if (panelData[panelByte] == 0) stream->print(F("none "));
else {
if (bitRead(panelData[panelByte], 0)) stream->print(F("Ready "));
if (bitRead(panelData[panelByte], 1)) stream->print(F("Armed "));
if (bitRead(panelData[panelByte], 2)) stream->print(F("Memory "));
if (bitRead(panelData[panelByte], 3)) stream->print(F("Bypass "));
if (bitRead(panelData[panelByte], 4)) stream->print(F("Trouble "));
if (bitRead(panelData[panelByte], 5)) stream->print(F("Program "));
if (bitRead(panelData[panelByte], 6)) stream->print(F("Fire "));
if (bitRead(panelData[panelByte], 7)) stream->print(F("Backlight "));
}
if (printMessage) {
stream->print(F("- "));
printPanelMessages(panelByte + 1);
}
}
/*
* Status messages for panel commands: 0x05, 0x0A, 0x1B, 0x27, 0x2D, 0x34, 0x3E
* Structure decoding: complete
* Content decoding: *incomplete
*/
void dscKeybusInterface::printPanelMessages(byte panelByte) {
switch (panelData[panelByte]) {
case 0x01: stream->print(F("Partition ready")); break;
case 0x02: stream->print(F("Stay zones open")); break;
case 0x03: stream->print(F("Zones open")); break;
case 0x04: stream->print(F("Armed: Stay")); break;
case 0x05: stream->print(F("Armed: Away")); break;
case 0x06: stream->print(F("Armed: Stay with no entry delay")); break;
case 0x07: stream->print(F("Failed to arm")); break;
case 0x08: stream->print(F("Exit delay in progress")); break;
case 0x09: stream->print(F("Arming: No entry delay")); break;
case 0x0B: stream->print(F("Quick exit in progress")); break;
case 0x0C: stream->print(F("Entry delay in progress")); break;
case 0x0D: stream->print(F("Entry delay after alarm")); break;
case 0x0E: stream->print(F("Function not available")); break;
case 0x10: stream->print(F("Keypad lockout")); break;
case 0x11: stream->print(F("Partition in alarm")); break;
case 0x12: stream->print(F("Battery check in progress")); break;
case 0x14: stream->print(F("Auto-arm in progress")); break;
case 0x15: stream->print(F("Arming with bypassed zones")); break;
case 0x16: stream->print(F("Armed: Away with no entry delay")); break;
case 0x19: stream->print(F("Disarmed: Alarm memory")); break;
case 0x22: stream->print(F("Disarmed: Recent closing")); break;
case 0x2F: stream->print(F("Keypad LCD test")); break;
case 0x33: stream->print(F("Command output in progress")); break;
case 0x3D: stream->print(F("Disarmed: Alarm memory")); break;
case 0x3E: stream->print(F("Partition disarmed")); break;
case 0x17: // Keypad blanking with trouble light flashing
case 0x40: stream->print(F("Keypad blanking")); break;
case 0x8A: stream->print(F("Activate stay/away zones")); break;
case 0x8B: stream->print(F("Quick exit")); break;
case 0x8E: stream->print(F("Function not available")); break;
case 0x8F: stream->print(F("Invalid access code")); break;
case 0x9E: stream->print(F("Enter * function key")); break;
case 0x9F: stream->print(F("Enter access code")); break;
case 0xA0: stream->print(F("*1: Zone bypass")); break;
case 0xA1: stream->print(F("*2: Trouble")); break;
case 0xA2: stream->print(F("*3: Alarm memory")); break;
case 0xA3: stream->print(F("Door chime enabled")); break;
case 0xA4: stream->print(F("Door chime disabled")); break;
case 0xA5: stream->print(F("Enter master code")); break;
case 0xA6: stream->print(F("*5: Access codes")); break;
case 0xA7: stream->print(F("*5: Enter 4-digit code")); break;
case 0xA9: stream->print(F("*6: User functions")); break;
case 0xAA: stream->print(F("*6: Time and date")); break;
case 0xAB: stream->print(F("*6: Auto-arm time")); break;
case 0xAC: stream->print(F("*6: Auto-arm enabled")); break;
case 0xAD: stream->print(F("*6: Auto-arm disabled")); break;
case 0xAF: stream->print(F("*6: System test")); break;
case 0xB0: stream->print(F("*6: Enable DLS")); break;
case 0xB2:
case 0xB3: stream->print(F("*7: Command output")); break;
case 0xB7: stream->print(F("Enter installer code")); break;
case 0xB8: stream->print(F("Enter * function key while armed")); break;
case 0xB9: stream->print(F("*2: Zone tamper menu")); break;
case 0xBA: stream->print(F("*2: Zones with low batteries")); break;
case 0xBC: stream->print(F("*5: Enter 6-digit code")); break;
case 0xBF: stream->print(F("*6: Auto-arm select day")); break;
case 0xC6: stream->print(F("*2: Zone fault menu")); break;
//case 0xC7: stream->print(F("Partition not available")); break;
case 0xC8: stream->print(F("*2: Service required menu")); break;
case 0xCD: stream->print(F("Downloading in progress")); break;
case 0xCE: stream->print(F("Active camera monitor selection")); break;
case 0xD0: stream->print(F("*2: Keypads with low batteries")); break;
case 0xD1: stream->print(F("*2: Keyfobs with low batteries")); break;
case 0xD4: stream->print(F("*2: Zones with RF Delinquency")); break;
case 0xE4: stream->print(F("*8: Installer programming, 3 digits")); decimalInput = false; break;
case 0xE5: stream->print(F("Keypad slot assignment")); break;
case 0xE6: stream->print(F("Input: 2 digits")); break;
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 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 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;
case 0xF2: stream->print(F("Function key 3")); break;
case 0xF3: stream->print(F("Function key 4")); break;
case 0xF4: stream->print(F("Function key 5")); break;
case 0xF5: stream->print(F("Wireless module placement test")); break;
case 0xF6: stream->print(F("Activate device for test")); break;
case 0xF7: stream->print(F("*8: Installer programming, 2 digits")); decimalInput = false; break;
case 0xF8: stream->print(F("Keypad programming")); break;
case 0xFA: stream->print(F("Input: 6 digits")); break;
default:
stream->print(F("Unknown data: 0x"));
if (panelData[panelByte] < 10) stream->print("0");
stream->print(panelData[panelByte], HEX);
break;
}
}
/*
* Status messages set 0x00 for panel commands: 0xA5, 0xAA, 0xCE, 0xEB, 0xEC
* Structure decoding: complete
* Content decoding: likely incomplete - observed messages from logs have been decoded, but there are gaps in
the numerical list of messages.
*
* These commands use 1 byte for the status message, and appear to use bits 0,1 of the preceding byte to
* select from multiple sets of status messages, split into printPanelStatus0...printPanelStatus2.
*/
void dscKeybusInterface::printPanelStatus0(byte panelByte) {
bool decoded = true;
switch (panelData[panelByte]) {
/*
* Command YYY1YYY2 MMMMDD DDDHHHHH MMMMMM Status CRC
* 10100101 0 00011000 01001111 10110000 11101100 01001001 11111111 11110000 [0xA5] 2018.03.29 16:59 | Partition 1 | Duress alarm
* 10100101 0 00011000 01001111 11001110 10111100 01001010 11111111 11011111 [0xA5] 2018.03.30 14:47 | Partition 1 | Disarmed after alarm in memory
* 10100101 0 00011000 01001111 11001010 01000100 01001011 11111111 01100100 [0xA5] 2018.03.30 10:17 | Partition 1 | Partition in alarm
* 10100101 0 00011000 01010000 01001001 10111000 01001100 11111111 01011001 [0xA5] 2018.04.02 09:46 | Partition 1 | Zone expander supervisory alarm
* 10100101 0 00011000 01010000 01001010 00000000 01001101 11111111 10100011 [0xA5] 2018.04.02 10:00 | Partition 1 | Zone expander supervisory restored
* 10100101 0 00011000 01001111 01110010 10011100 01001110 11111111 01100111 [0xA5] 2018.03.27 18:39 | Partition 1 | Keypad Fire alarm
* 10100101 0 00011000 01001111 01110010 10010000 01001111 11111111 01011100 [0xA5] 2018.03.27 18:36 | Partition 1 | Keypad Aux alarm
* 10100101 0 00011000 01001111 01110010 10001000 01010000 11111111 01010101 [0xA5] 2018.03.27 18:34 | Partition 1 | Keypad Panic alarm
* 10100101 0 00010110 00010111 11101101 00010000 01010000 10010001 10110000 [0xA5] 2016.05.31 13:04 | Keypad Panic alarm
* 10100101 0 00010001 01101101 01100000 00000100 01010001 11111111 11010111 [0xA5] 2011.11.11 00:01 | Partition 1 | Auxiliary input alarm
* 10100101 0 00011000 01001111 01110010 10011100 01010010 11111111 01101011 [0xA5] 2018.03.27 18:39 | Partition 1 | Keypad Fire alarm restored
* 10100101 0 00011000 01001111 01110010 10010000 01010011 11111111 01100000 [0xA5] 2018.03.27 18:36 | Partition 1 | Keypad Aux alarm restored
* 10100101 0 00011000 01001111 01110010 10001000 01010100 11111111 01011001 [0xA5] 2018.03.27 18:34 | Partition 1 | Keypad Panic alarm restored
* 10100101 0 00011000 01001111 11110110 00110100 10011000 11111111 11001101 [0xA5] 2018.03.31 22:13 | Partition 1 | Keypad lockout
* 10100101 0 00011000 01001111 11101011 10100100 10111110 11111111 01011000 [0xA5] 2018.03.31 11:41 | Partition 1 | Armed partial: Zones bypassed
* 10100101 0 00011000 01001111 11101011 00011000 10111111 11111111 11001101 [0xA5] 2018.03.31 11:06 | Partition 1 | Armed special: quick-arm/auto-arm/keyswitch/wireless key/DLS
* 10100101 0 00010001 01101101 01100000 00101000 11100101 11111111 10001111 [0xA5] 2011.11.11 00:10 | Partition 1 | Auto-arm cancelled
* 10100101 0 00011000 01001111 11110111 01000000 11100110 11111111 00101000 [0xA5] 2018.03.31 23:16 | Partition 1 | Disarmed special: keyswitch/wireless key/DLS
* 10100101 0 00011000 01001111 01101111 01011100 11100111 11111111 10111101 [0xA5] 2018.03.27 15:23 | Partition 1 | Panel battery trouble
* 10100101 0 00011000 01001111 10110011 10011000 11101000 11111111 00111110 [0xA5] 2018.03.29 19:38 | Partition 1 | Panel AC power trouble
* 10100101 0 00011000 01001111 01110100 01010000 11101001 11111111 10111000 [0xA5] 2018.03.27 20:20 | Partition 1 | Bell trouble
* 10100101 0 00011000 01001111 11000000 10001000 11101100 11111111 00111111 [0xA5] 2018.03.30 00:34 | Partition 1 | Telephone line trouble
* 10100101 0 00011000 01001111 01101111 01110000 11101111 11111111 11011001 [0xA5] 2018.03.27 15:28 | Partition 1 | Panel battery restored
* 10100101 0 00011000 01010000 00100000 01011000 11110000 11111111 01110100 [0xA5] 2018.04.01 00:22 | Partition 1 | Panel AC power restored
* 10100101 0 00011000 01001111 01110100 01011000 11110001 11111111 11001000 [0xA5] 2018.03.27 20:22 | Partition 1 | Bell restored
* 10100101 0 00011000 01001111 11000000 10001000 11110100 11111111 01000111 [0xA5] 2018.03.30 00:34 | Partition 1 | Telephone line restored
* 10100101 0 00011000 01001111 11100001 01011000 11111111 11111111 01000011 [0xA5] 2018.03.31 01:22 | Partition 1 | System test
* Byte 0 1 2 3 4 5 6 7 8
*/
// 0x09 - 0x28: Zone alarm, zones 1-32
// 0x29 - 0x48: Zone alarm restored, zones 1-32
case 0x49: stream->print(F("Duress alarm")); break;
case 0x4A: stream->print(F("Disarmed: Alarm memory")); break;
case 0x4B: stream->print(F("Recent closing alarm")); break;
case 0x4C: stream->print(F("Zone expander supervisory alarm")); break;
case 0x4D: stream->print(F("Zone expander supervisory restored")); break;
case 0x4E: stream->print(F("Keypad Fire alarm")); break;
case 0x4F: stream->print(F("Keypad Aux alarm")); break;
case 0x50: stream->print(F("Keypad Panic alarm")); break;
case 0x51: stream->print(F("PGM2 input alarm")); break;
case 0x52: stream->print(F("Keypad Fire alarm restored")); break;
case 0x53: stream->print(F("Keypad Aux alarm restored")); break;
case 0x54: stream->print(F("Keypad Panic alarm restored")); break;
case 0x55: stream->print(F("PGM2 input alarm restored")); break;
// 0x56 - 0x75: Zone tamper, zones 1-32
// 0x76 - 0x95: Zone tamper restored, zones 1-32
case 0x98: stream->print(F("Keypad lockout")); break;
// 0x99 - 0xBD: Armed: Access codes 1-34, 40-42
case 0xBE: stream->print(F("Armed: Partial")); break;
case 0xBF: stream->print(F("Armed: Special")); break;
// 0xC0 - 0xE4: Disarmed: Access codes 1-34, 40-42
case 0xE5: stream->print(F("Auto-arm cancelled")); break;
case 0xE6: stream->print(F("Disarmed: Special")); break;
case 0xE7: stream->print(F("Panel battery trouble")); break;
case 0xE8: stream->print(F("Panel AC power trouble")); break;
case 0xE9: stream->print(F("Bell trouble")); break;
case 0xEA: stream->print(F("Fire zone trouble")); break;
case 0xEB: stream->print(F("Panel aux supply trouble")); break;
case 0xEC: stream->print(F("Telephone line trouble")); break;
case 0xEF: stream->print(F("Panel battery restored")); break;
case 0xF0: stream->print(F("Panel AC power restored")); break;
case 0xF1: stream->print(F("Bell restored")); break;
case 0xF2: stream->print(F("Fire zone trouble restored")); break;
case 0xF3: stream->print(F("Panel aux supply restored")); break;
case 0xF4: stream->print(F("Telephone line restored")); break;
case 0xF7: stream->print(F("Phone 1 FTC")); break;
case 0xF8: stream->print(F("Phone 2 FTC")); break;
case 0xF9: stream->print(F("Event buffer threshold")); break; //75% full since last DLS upload
case 0xFA: stream->print(F("DLS lead-in")); break;
case 0xFB: stream->print(F("DLS lead-out")); break;
case 0xFE: stream->print(F("Periodic test transmission")); break;
case 0xFF: stream->print(F("System test")); break;
default: decoded = false;
}
if (decoded) return;
/*
* Zone alarm, zones 1-32
*
* Command YYY1YYY2 MMMMDD DDDHHHHH MMMMMM Status CRC
* 10100101 0 00011000 01001111 01001001 11011000 00001001 11111111 00110101 [0xA5] 2018.03.26 09:54 | Partition 1 | Zone alarm: 1
* 10100101 0 00011000 01001111 01001010 00100000 00001110 11111111 10000011 [0xA5] 2018.03.26 10:08 | Partition 1 | Zone alarm: 6
* 10100101 0 00011000 01001111 10010100 11001000 00010000 11111111 01110111 [0xA5] 2018.03.28 20:50 | Partition 1 | Zone alarm: 8
* Byte 0 1 2 3 4 5 6 7 8
*/
if (panelData[panelByte] >= 0x09 && panelData[panelByte] <= 0x28) {
stream->print("Zone alarm: ");
printNumberOffset(panelByte, -8);
return;
}
/*
* Zone alarm restored, zones 1-32
*
* Command YYY1YYY2 MMMMDD DDDHHHHH MMMMMM Status CRC
* 10100101 0 00011000 01001111 10010100 11001100 00101001 11111111 10010100 [0xA5] 2018.03.28 20:51 | Partition 1 | Zone alarm restored: 1
* 10100101 0 00011000 01001111 10010100 11010100 00101110 11111111 10100001 [0xA5] 2018.03.28 20:53 | Partition 1 | Zone alarm restored: 6
* 10100101 0 00011000 01001111 10010100 11010000 00110000 11111111 10011111 [0xA5] 2018.03.28 20:52 | Partition 1 | Zone alarm restored: 8
* Byte 0 1 2 3 4 5 6 7 8
*/
if (panelData[panelByte] >= 0x29 && panelData[panelByte] <= 0x48) {
stream->print("Zone alarm restored: ");
printNumberOffset(panelByte, -40);
return;
}
/*
* Zone tamper, zones 1-32
*
* Command YYY1YYY2 MMMMDD DDDHHHHH MMMMMM Status CRC
* 10100101 0 00000001 01000100 00100010 01011100 01010110 11111111 10111101 [0xA5] 2001.01.01 02:23 | Partition 1 | Zone tamper: 1
* 10100101 0 00010001 01101101 01101011 10010000 01011011 11111111 01111000 [0xA5] 2011.11.11 11:36 | Partition 1 | Zone tamper: 6
* 11101011 0 10000000 00100000 00101010 00010111 11010000 00000000 01010111 11111111 11110010 [0xEB] 2020.10.16 23:52 | Partition 8 | Zone tamper: 2
* Byte 0 1 2 3 4 5 6 7 8 9 10
*/
if (panelData[panelByte] >= 0x56 && panelData[panelByte] <= 0x75) {
stream->print("Zone tamper: ");
printNumberOffset(panelByte, -85);
return;
}
/*
* Zone tamper restored, zones 1-32
*
* Command YYY1YYY2 MMMMDD DDDHHHHH MMMMMM Status CRC
* 10100101 0 00000001 01000100 00100010 01011100 01110110 11111111 11011101 [0xA5] 2001.01.01 02:23 | Partition 1 | Zone tamper restored: 1
* 10100101 0 00010001 01101101 01101011 10010000 01111011 11111111 10011000 [0xA5] 2011.11.11 11:36 | Partition 1 | Zone tamper restored: 6
* Byte 0 1 2 3 4 5 6 7 8
*/
if (panelData[panelByte] >= 0x76 && panelData[panelByte] <= 0x95) {
stream->print("Zone tamper restored: ");
printNumberOffset(panelByte, -117);
return;
}
/*
* Armed by access codes 1-34, 40-42
*
* Command YYY1YYY2 MMMMDD DDDHHHHH MMMMMM Status CRC
* 10100101 0 00011000 01001101 00001000 10010000 10011001 11111111 00111010 [0xA5] 2018.03.08 08:36 | Partition 1 | Armed: User code 1
* 10100101 0 00011000 01001101 00001000 10111100 10111011 11111111 10001000 [0xA5] 2018.03.08 08:47 | Partition 1 | Armed: Master code 40
* Byte 0 1 2 3 4 5 6 7 8
*/
if (panelData[panelByte] >= 0x99 && panelData[panelByte] <= 0xBD) {
byte dscCode = panelData[panelByte] - 0x98;
stream->print(F("Armed: "));
printPanelAccessCode(dscCode);
return;
}
/*
* Disarmed by access codes 1-34, 40-42
*
* Command YYY1YYY2 MMMMDD DDDHHHHH MMMMMM Status CRC
* 10100101 0 00011000 01001101 00001000 11101100 11000000 11111111 10111101 [0xA5] 2018.03.08 08:59 | Partition 1 | Disarmed: User code 1
* 10100101 0 00011000 01001101 00001000 10110100 11100010 11111111 10100111 [0xA5] 2018.03.08 08:45 | Partition 1 | Disarmed: Master code 40
* Byte 0 1 2 3 4 5 6 7 8
*/
if (panelData[panelByte] >= 0xC0 && panelData[panelByte] <= 0xE4) {
byte dscCode = panelData[panelByte] - 0xBF;
stream->print(F("Disarmed: "));
printPanelAccessCode(dscCode);
return;
}
stream->print("Unknown data");
}
/*
* Status messages set 0x01 for panel commands: 0xA5, 0xAA, 0xCE, 0xEB, 0xEC
* Structure decoding: complete
* Content decoding: likely incomplete - observed messages from logs have been decoded, but there are gaps in
* the numerical list of messages.
*
* These commands use 1 byte for the status message, and appear to use bits 0,1 of the preceding byte to
* select from multiple sets of status messages, split into printPanelStatus0...printPanelStatus3.
*/
void dscKeybusInterface::printPanelStatus1(byte panelByte) {
switch (panelData[panelByte]) {
/*
* Command YYY1YYY2 MMMMDD DDDHHHHH MMMMMM Status CRC
* 10100101 0 00011000 01001111 11001010 10001001 00000011 11111111 01100001 [0xA5] 2018.03.30 10:34 | Partition 1 | Cross zone alarm
* 10100101 0 00010001 01101101 01101010 00000001 00000100 11111111 10010001 [0xA5] 2011.11.11 10:00 | Partition 1 | Delinquency alarm
* 10100101 0 00010001 01101101 01100000 10101001 00100100 00000000 01010000 [0xA5] 2011.11.11 00:42 | Partition 1 | Duress code 33
* 10100101 0 00010001 01101101 01100000 10110101 00100101 00000000 01011101 [0xA5] 2011.11.11 00:45 | Partition 1 | Duress code 34
* 10100101 0 00010001 01101101 01100000 00101001 00100110 00000000 11010010 [0xA5] 2011.11.11 00:10 | Partition 1 | Master code 40
* 10100101 0 00010001 01101101 01100000 10010001 00100111 00000000 00111011 [0xA5] 2011.11.11 00:36 | Partition 1 | Supervisor code 41
* 10100101 0 00010001 01101101 01100000 10111001 00101000 00000000 01100100 [0xA5] 2011.11.11 00:46 | Partition 1 | Supervisor code 42
* 10100101 0 00011000 01001111 10100000 10011101 00101011 00000000 01110100 [0xA5] 2018.03.29 00:39 | Partition 1 | Armed: Auto-arm
* 10100101 0 00011000 01001101 00001010 00001101 10101100 00000000 11001101 [0xA5] 2018.03.08 10:03 | Partition 1 | Exit *8 programming
* 10100101 0 00011000 01001101 00001001 11100001 10101101 00000000 10100001 [0xA5] 2018.03.08 09:56 | Partition 1 | Enter *8 programming
* 10100101 0 00010001 01101101 01100010 11001101 11010000 00000000 00100010 [0xA5] 2011.11.11 02:51 | Partition 1 | Command output 4
* 10100101 0 00010110 01010110 00101011 11010001 11010010 00000000 11011111 [0xA5] 2016.05.17 11:52 | Partition 1 | Armed with no entry delay cancelled
* Byte 0 1 2 3 4 5 6 7 8
*/
case 0x03: stream->print(F("Cross zone alarm")); return;
case 0x04: stream->print(F("Delinquency alarm")); return;
case 0x05: stream->print(F("Late to close")); return;
// 0x24 - 0x28: Access codes 33-34, 40-42
case 0x29: stream->print(F("Downloading forced answer")); return;
case 0x2B: stream->print(F("Armed: Auto-arm")); return;
// 0x2C - 0x4B: Zone battery restored, zones 1-32
// 0x4C - 0x6B: Zone battery low, zones 1-32
// 0x6C - 0x8B: Zone fault restored, zones 1-32
// 0x8C - 0xAB: Zone fault, zones 1-32
case 0xAC: stream->print(F("Exit installer programming")); return;
case 0xAD: stream->print(F("Enter installer programming")); return;
case 0xAE: stream->print(F("Walk test end")); return;
case 0xAF: stream->print(F("Walk test begin")); return;
// 0xB0 - 0xCF: Zones bypassed, zones 1-32
case 0xD0: stream->print(F("Command output 4")); return;
case 0xD1: stream->print(F("Exit fault pre-alert")); return;
case 0xD2: stream->print(F("Armed: Entry delay")); return;
case 0xD3: stream->print(F("Downlook remote trigger")); return;
}
/*
* Access codes 33-34, 40-42
*
* Command YYY1YYY2 MMMMDD DDDHHHHH MMMMMM Status CRC
* 10100101 0 00010001 01101101 01100000 10101001 00100100 00000000 01010000 [0xA5] 2011.11.11 00:42 | Partition 1 | Duress code 33
* 10100101 0 00010001 01101101 01100000 10110101 00100101 00000000 01011101 [0xA5] 2011.11.11 00:45 | Partition 1 | Duress code 34
* 10100101 0 00010001 01101101 01100000 00101001 00100110 00000000 11010010 [0xA5] 2011.11.11 00:10 | Partition 1 | Master code 40
* 10100101 0 00010001 01101101 01100000 10010001 00100111 00000000 00111011 [0xA5] 2011.11.11 00:36 | Partition 1 | Supervisor code 41
* 10100101 0 00010001 01101101 01100000 10111001 00101000 00000000 01100100 [0xA5] 2011.11.11 00:46 | Partition 1 | Supervisor code 42
* Byte 0 1 2 3 4 5 6 7 8
*/
if (panelData[panelByte] >= 0x24 && panelData[panelByte] <= 0x28) {
byte dscCode = panelData[panelByte] - 0x03;
printPanelAccessCode(dscCode);
return;
}
/*
* Zone battery restored, zones 1-32
*/
if (panelData[panelByte] >= 0x2C && panelData[panelByte] <= 0x4B) {
stream->print(F("Zone battery restored: "));
printNumberOffset(panelByte, -43);
return;
}
/*
* Zone low battery, zones 1-32
*/
if (panelData[panelByte] >= 0x4C && panelData[panelByte] <= 0x6B) {
stream->print(F("Zone battery low: "));
printNumberOffset(panelByte, -75);
return;
}
/*
* Zone fault restored, zones 1-32
*
* Command YYY1YYY2 MMMMDD DDDHHHHH MMMMMM Status CRC
* 10100101 0 00010001 01101101 01101011 01000001 01101100 11111111 00111010 [0xA5] 2011.11.11 11:16 | Partition 1 | Zone fault restored: 1
* 10100101 0 00010001 01101101 01101011 01010101 01101101 11111111 01001111 [0xA5] 2011.11.11 11:21 | Partition 1 | Zone fault restored: 2
* 10100101 0 00010001 01101101 01101011 10000101 01101111 11111111 10000001 [0xA5] 2011.11.11 11:33 | Partition 1 | Zone fault restored: 4
* 10100101 0 00010001 01101101 01101011 10001001 01110000 11111111 10000110 [0xA5] 2011.11.11 11:34 | Partition 1 | Zone fault restored: 5
* Byte 0 1 2 3 4 5 6 7 8
*/
if (panelData[panelByte] >= 0x6C && panelData[panelByte] <= 0x8B) {
stream->print(F("Zone fault restored: "));
printNumberOffset(panelByte, -107);
return;
}
/*
* Zone fault, zones 1-32
*
* Command YYY1YYY2 MMMMDD DDDHHHHH MMMMMM Status CRC
* 10100101 0 00010001 01101101 01101011 00111101 10001100 11111111 01010110 [0xA5] 2011.11.11 11:15 | Partition 1 | Zone fault: 1
* 10100101 0 00010001 01101101 01101011 01010101 10001101 11111111 01101111 [0xA5] 2011.11.11 11:21 | Partition 1 | Zone fault: 2
* 10100101 0 00010001 01101101 01101011 10000001 10001111 11111111 10011101 [0xA5] 2011.11.11 11:32 | Partition 1 | Zone fault: 4
* 10100101 0 00010001 01101101 01101011 10001001 10010000 11111111 10100110 [0xA5] 2011.11.11 11:34 | Partition 1 | Zone fault: 5
* Byte 0 1 2 3 4 5 6 7 8
*/
if (panelData[panelByte] >= 0x8C && panelData[panelByte] <= 0xAB) {
stream->print(F("Zone fault: "));
printNumberOffset(panelByte, -139);
return;
}
/*
* Zones bypassed, zones 1-32
*
* Command YYY1YYY2 MMMMDD DDDHHHHH MMMMMM Status CRC
* 10100101 0 00011000 01001111 10110001 10101001 10110001 00000000 00010111 [0xA5] 2018.03.29 17:42 | Partition 1 | Zone bypassed: 2
* 10100101 0 00011000 01001111 10110001 11000001 10110101 00000000 00110011 [0xA5] 2018.03.29 17:48 | Partition 1 | Zone bypassed: 6
* Byte 0 1 2 3 4 5 6 7 8
*/
if (panelData[panelByte] >= 0xB0 && panelData[panelByte] <= 0xCF) {
stream->print(F("Zone bypassed: "));
printNumberOffset(panelByte, -175);
return;
}
stream->print("Unknown data");
}
/*
* Status messages set 0x02 for panel commands: 0xAA, 0xCE, 0xEB, 0xEC
* Structure decoding: complete
* Content decoding: likely incomplete - observed messages from logs have been decoded, but there are gaps in
* the numerical list of messages.
*
* These commands use 1 byte for the status message, and appear to use bits 0,1 of the preceding byte to
* select from multiple sets of status messages, split into printPanelStatus0...printPanelStatus3.
*/
void dscKeybusInterface::printPanelStatus2(byte panelByte) {
switch (panelData[panelByte]) {
/*
* Command YYY1YYY2 MMMMDD DDDHHHHH MMMMMM Status CRC
* 10100101 0 00011000 01001111 10101111 10000110 00101010 00000000 01101011 [0xA5] 2018.03.29 15:33 | Partition 1 | Quick exit
* 10100101 0 00010001 01101101 01110101 00111010 01100011 00000000 00110101 [0xA5] 2011.11.11 21:14 | Partition 1 | Keybus fault restored
* 10100101 0 00011000 01001111 11110111 01110110 01100110 00000000 11011111 [0xA5] 2018.03.31 23:29 | Partition 1 | Enter *1 zone bypass programming
* 10100101 0 00010001 01101101 01100010 11001110 01101001 00000000 10111100 [0xA5] 2011.11.11 02:51 | Partition 1 | Command output 3
* 10100101 0 00011000 01010000 01000000 00000010 10001100 00000000 11011011 [0xA5] 2018.04.02 00:00 | Partition 1 | Loss of system time
* 10100101 0 00011000 01001111 10101110 00001110 10001101 00000000 01010101 [0xA5] 2018.03.29 14:03 | Partition 1 | Power on
* 10100101 0 00011000 01010000 01000000 00000010 10001110 00000000 11011101 [0xA5] 2018.04.02 00:00 | Partition 1 | Panel factory default
* 10100101 0 00011000 01001111 11101010 10111010 10010011 00000000 01000011 [0xA5] 2018.03.31 10:46 | Partition 1 | Disarmed by keyswitch
* 10100101 0 00011000 01001111 11101010 10101110 10010110 00000000 00111010 [0xA5] 2018.03.31 10:43 | Partition 1 | Armed by keyswitch
* 10100101 0 00011000 01001111 10100000 01100010 10011000 00000000 10100110 [0xA5] 2018.03.29 00:24 | Partition 1 | Armed by quick-arm
* 10100101 0 00010001 01101101 01100000 00101110 10011001 00000000 01001010 [0xA5] 2011.11.11 00:11 | Partition 1 | Activate stay/away zones
* 10100101 0 00011000 01001111 00101101 00011010 10011010 00000000 11101101 [0xA5] 2018.03.25 13:06 | Partition 1 | Armed: stay
* 10100101 0 00011000 01001111 00101101 00010010 10011011 00000000 11100110 [0xA5] 2018.03.25 13:04 | Partition 1 | Armed: away
* 10100101 0 00011000 01001111 00101101 10011010 10011100 00000000 01101111 [0xA5] 2018.03.25 13:38 | Partition 1 | Armed with no entry delay
* 10100101 0 00011000 01001111 00101100 11011110 11000011 00000000 11011001 [0xA5] 2018.03.25 12:55 | Partition 1 | Enter *5 programming
* 10100101 0 00011000 01001111 00101110 00000010 11100110 00000000 00100010 [0xA5] 2018.03.25 14:00 | Partition 1 | Enter *6 programming
* Byte 0 1 2 3 4 5 6 7 8
*/
case 0x2A: stream->print(F("Quick exit")); return;
case 0x63: stream->print(F("Keybus fault restored")); return;
case 0x64: stream->print(F("Keybus fault")); return;
case 0x66: stream->print(F("*1: Zone bypass")); return;
// 0x67 - 0x69: *7: Command output 1-3
case 0x8C: stream->print(F("Cold start")); return;
case 0x8D: stream->print(F("Warm start")); return;
case 0x8E: stream->print(F("Panel factory default")); return;
case 0x91: stream->print(F("Swinger shutdown")); return;
case 0x93: stream->print(F("Disarmed: Keyswitch")); return;
case 0x96: stream->print(F("Armed: Keyswitch")); return;
case 0x97: stream->print(F("Armed: Keypad away")); return;
case 0x98: stream->print(F("Armed: Quick-arm")); return;
case 0x99: stream->print(F("Activate stay/away zones")); return;
case 0x9A: stream->print(F("Armed: Stay")); return;
case 0x9B: stream->print(F("Armed: Away")); return;
case 0x9C: stream->print(F("Armed: No entry delay")); return;
// 0x9E - 0xC2: *1: Access codes 1-34, 40-42
// 0xC3 - 0xC5: *5: Access codes 40-42
// 0xC6 - 0xE5: Access codes 1-34, 40-42
// 0xE6 - 0xE8: *6: Access codes 40-42
// 0xE9 - 0xF0: Keypad restored: Slots 1-8
// 0xF1 - 0xF8: Keypad trouble: Slots 1-8
// 0xF9 - 0xFE: Zone expander restored: 1-6
case 0xFF: stream->print(F("Zone expander trouble: 1")); return;
}
/*
* *7: Command output 1-3
*/
if (panelData[panelByte] >= 0x67 && panelData[panelByte] <= 0x69) {
stream->print(F("Command output: "));
printNumberOffset(panelByte, -0x66);
return;
}
/*
* *1: Access codes 1-34, 40-42
*/
if (panelData[panelByte] >= 0x9E && panelData[panelByte] <= 0xC2) {
byte dscCode = panelData[panelByte] - 0x9D;
stream->print(F("*1: "));
printPanelAccessCode(dscCode);
return;
}
/*
* *5: Access codes 40-42
*/
if (panelData[panelByte] >= 0xC3 && panelData[panelByte] <= 0xC5) {
byte dscCode = panelData[panelByte] - 0xA0;
stream->print(F("*5: "));
printPanelAccessCode(dscCode);
return;
}
/*
* Access codes 1-32
*
* Command YYY1YYY2 MMMMDD DDDHHHHH MMMMMM Status CRC
* 10100101 0 00010001 01101101 01100000 00111110 11000110 00000000 10000111 [0xA5] 2011.11.11 00:15 | Partition 1 | User code 1
* 10100101 0 00010001 01101101 01100000 01111010 11100101 00000000 11100010 [0xA5] 2011.11.11 00:30 | Partition 1 | User code 32
* Byte 0 1 2 3 4 5 6 7 8
*/
if (panelData[panelByte] >= 0xC6 && panelData[panelByte] <= 0xE5) {
byte dscCode = panelData[panelByte] - 0xC5;
printPanelAccessCode(dscCode);
return;
}
/*
* *6: Access codes 40-42
*/
if (panelData[panelByte] >= 0xE6 && panelData[panelByte] <= 0xE8) {
byte dscCode = panelData[panelByte] - 0xC3;
stream->print(F("*6: "));
printPanelAccessCode(dscCode);
return;
}
/*
* Keypad restored: Slots 1-8
*
* Command YYY1YYY2 MMMMDD DDDHHHHH MMMMMM Status CRC
* 10100101 0 00010001 01101101 01110100 10001110 11101001 11111111 00001101 [0xA5] 2011.11.11 20:35 | Partition 1 | Keypad restored: Slot 1
* 10100101 0 00010001 01101101 01110100 00110010 11110000 11111111 10111000 [0xA5] 2011.11.11 20:12 | Partition 1 | Keypad restored: Slot 8
* Byte 0 1 2 3 4 5 6 7 8
*/
if (panelData[panelByte] >= 0xE9 && panelData[panelByte] <= 0xF0) {
stream->print(F("Keypad restored: Slot "));
printNumberOffset(panelByte, -232);
return;
}
/*
* Keypad trouble: Slots 1-8
*
* Command YYY1YYY2 MMMMDD DDDHHHHH MMMMMM Status CRC
* 10100101 0 00010001 01101101 01110100 10000110 11110001 11111111 00001101 [0xA5] 2011.11.11 20:33 | Partition 1 | Keypad trouble: Slot 1
* 10100101 0 00010001 01101101 01110100 00101110 11111000 11111111 10111100 [0xA5] 2011.11.11 20:11 | Partition 1 | Keypad trouble: Slot 8
* Byte 0 1 2 3 4 5 6 7 8
*/
if (panelData[panelByte] >= 0xF1 && panelData[panelByte] <= 0xF8) {
stream->print(F("Keypad trouble: Slot "));
printNumberOffset(panelByte, -240);
return;
}
/*
* Zone expander restored: 1-6
*/
if (panelData[panelByte] >= 0xF9 && panelData[panelByte] <= 0xFE) {
stream->print(F("Zone expander restored: "));
printNumberOffset(panelByte, -248);
return;
}
stream->print("Unknown data");
}
/*
* Status messages set 0x03 for panel commands: 0xAA, 0xCE, 0xEB, 0xEC
* Structure decoding: complete
* Content decoding: likely incomplete - observed messages from logs have been decoded, but there are gaps in
* the numerical list of messages.
*
* These commands use 1 byte for the status message, and appear to use bits 0,1 of the preceding byte to
* select from multiple sets of status messages, split into printPanelStatus0...printPanelStatus3.
*
* Command YYY1YYY2 MMMMDD DDDHHHHH MMMMMM Status CRC
* 10100101 0 00100000 00101010 01100000 10111111 01000010 11111111 01001111 [0xA5] 2020.10.19 00:47 | PC/RF5132: Tamper
* 10100101 0 00100000 00101010 01100000 10111111 01000001 11111111 01001110 [0xA5] 2020.10.19 00:47 | PC/RF5132: Tamper restored
* 10100101 0 00100000 00001001 10000000 11010011 01000100 11111111 01100100 [0xA5] 2020.02.12 00:52 | PC5208: Tamper
* 10100101 0 00100000 00101010 11000000 11011111 01010001 11111111 11011110 [0xA5] 2020.10.22 00:55 | Module tamper restored: Slot 16
* 10100101 0 00100000 00101010 11000000 11011111 01010010 11111111 11011111 [0xA5] 2020.10.22 00:55 | Module tamper: Slot 16
* Byte 0 1 2 3 4 5 6 7 8
*/
void dscKeybusInterface::printPanelStatus3(byte panelByte) {
switch (panelData[panelByte]) {
case 0x05: stream->print(F("PC/RF5132: Supervisory restored")); return;
case 0x06: stream->print(F("PC/RF5132: Supervisory trouble")); return;
case 0x09: stream->print(F("PC5204: Supervisory restored")); return;
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;
// 0x25 - 0x2C: Keypad tamper restored, slots 1-8
// 0x2D - 0x34: Keypad tamper, slots 1-8
// 0x35 - 0x3A: Module tamper restored, slots 9-14
// 0x3B - 0x40: Module tamper, slots 9-14
case 0x41: stream->print(F("PC/RF5132: Tamper restored")); return;
case 0x42: stream->print(F("PC/RF5132: Tamper")); return;
case 0x43: stream->print(F("PC5208: Tamper restored")); return;
case 0x44: stream->print(F("PC5208: Tamper")); return;
case 0x45: stream->print(F("PC5204: Tamper restored")); return;
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;
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;
case 0xB6: stream->print(F("PC5204: Aux supply trouble")); return;
case 0xB7: stream->print(F("PC5204: Output 1 restored")); return;
case 0xB8: stream->print(F("PC5204: Output 1 trouble")); return;
case 0xFF: stream->print(F("Extended status")); return;
}
/*
* Zone expander trouble: 2-6
*/
if (panelData[panelByte] <= 0x04) {
stream->print(F("Zone expander trouble: "));
printNumberOffset(panelByte, 2);
return;
}
/*
* Keypad tamper restored: 1-8
*/
if (panelData[panelByte] >= 0x25 && panelData[panelByte] <= 0x2C) {
stream->print(F("Keypad tamper restored: "));
printNumberOffset(panelByte, -0x24);
return;
}
/*
* Keypad tamper: 1-8
*/
if (panelData[panelByte] >= 0x2D && panelData[panelByte] <= 0x34) {
stream->print(F("Keypad tamper: "));
printNumberOffset(panelByte, -0x2C);
return;
}
/*
* Zone expander tamper restored: 1-6
*
* Command YYY1YYY2 MMMMDD DDDHHHHH MMMMMM Status CRC
* 10100101 0 00100000 00101010 11000110 00101011 00110101 11111111 00010100 [0xA5] 2020.10.22 06:10 | Zone expander tamper restored: 1
* 10100101 0 00100000 00101010 11000000 00101111 00111010 11111111 00010111 [0xA5] 2020.10.22 00:11 | Zone expander tamper restored: 6
* 11101011 0 00000000 00100000 00101010 11000110 00101000 00000011 00110101 11111111 01011010 [0xEB] 2020.10.22 06:10 | Zone expander tamper restored: 1
* Byte 0 1 2 3 4 5 6 7 8 9 10
*/
if (panelData[panelByte] >= 0x35 && panelData[panelByte] <= 0x3A) {
stream->print(F("Zone expander tamper restored: "));
printNumberOffset(panelByte, -52);
return;
}
/*
* Zone expander tamper: 1-6
*
* Command YYY1YYY2 MMMMDD DDDHHHHH MMMMMM Status CRC
* 10100101 0 00100000 00101010 11000110 00101011 00111011 11111111 00011010 [0xA5] 2020.10.22 06:10 | Zone expander tamper: 1
* 10100101 0 00100000 00101010 11000000 00101111 01000000 11111111 00011101 [0xA5] 2020.10.22 00:11 | Zone expander tamper: 6
* 11101011 0 00000000 00100000 00101010 11000110 00101000 00000011 00111011 11111111 01100000 [0xEB] 2020.10.22 06:10 | Zone expander tamper: 1
* Byte 0 1 2 3 4 5 6 7 8 9 10
*/
if (panelData[panelByte] >= 0x3B && panelData[panelByte] <= 0x40) {
stream->print(F("Zone expander tamper: "));
printNumberOffset(panelByte, -58);
return;
}
stream->print("Unknown data");
}
/*
* Status messages set 0x04 for panel commands: 0xEB, 0xEC
* Structure decoding: complete
* Content decoding: likely incomplete - observed messages from logs have been decoded, but there are gaps in
* the numerical list of messages.
*
* These commands use 1 byte for the status message, and appear to use the preceding byte to select
* from multiple sets of status messages, split into printPanelStatus4...printPanelStatus1B.
*
* Command Partition YYY1YYY2 MMMMDD DDDHHHHH MMMMMM Status CRC
* 11101011 0 00000001 00011000 00011000 10001111 00101000 00000100 00000000 10010001 01101000 [0xEB] 2018.06.04 15:10 | Partition 1 | Zone alarm: 33
* 11101011 0 00000001 00000001 00000100 01100000 00010100 00000100 01000000 10000001 00101010 [0xEB] 2001.01.03 00:05 | Partition 1 | Zone tamper: 33
* 11101011 0 00000001 00000001 00000100 01100000 00001000 00000100 01011111 10000001 00111101 [0xEB] 2001.01.03 00:02 | Partition 1 | Zone tamper: 64
* 11101011 0 00000001 00000001 00000100 01100000 00011000 00000100 01100000 11111111 11001100 [0xEB] 2001.01.03 00:06 | Partition 1 | Zone tamper restored: 33
* Byte 0 1 2 3 4 5 6 7 8 9 10
*/
void dscKeybusInterface::printPanelStatus4(byte panelByte) {
switch (panelData[panelByte]) {
case 0x86: stream->print(F("Periodic test with trouble")); return;
case 0x87: stream->print(F("Exit fault")); return;
case 0x89: stream->print(F("Alarm cancelled")); return;
}
if (panelData[panelByte] <= 0x1F) {
stream->print("Zone alarm: ");
printNumberOffset(panelByte, 33);
}
else if (panelData[panelByte] >= 0x20 && panelData[panelByte] <= 0x3F) {
stream->print("Zone alarm restored: ");
printNumberOffset(panelByte, 1);
}
else if (panelData[panelByte] >= 0x40 && panelData[panelByte] <= 0x5F) {
stream->print("Zone tamper: ");
printNumberOffset(panelByte, -31);
}
else if (panelData[panelByte] >= 0x60 && panelData[panelByte] <= 0x7F) {
stream->print("Zone tamper restored: ");
printNumberOffset(panelByte, -63);
}
else stream->print("Unknown data");
}
/*
* Status messages set 0x05 for panel commands: 0xEB, 0xEC
* Structure decoding: complete
* Content decoding: likely incomplete - observed messages from logs have been decoded, but there are gaps in
* the numerical list of messages.
*
* These commands use 1 byte for the status message, and appear to use the preceding byte to select
* from multiple sets of status messages, split into printPanelStatus4...printPanelStatus1B.
*/
void dscKeybusInterface::printPanelStatus5(byte panelByte) {
/*
* Armed by access codes 35-95
* 0x00 - 0x04: Access codes 35-39
* 0x05 - 0x39: Access codes 43-95
*/
if (panelData[panelByte] <= 0x39) {
byte dscCode = panelData[panelByte] + 0x23;
stream->print(F("Armed: "));
printPanelAccessCode(dscCode, false);
return;
}
/*
* Disarmed by access codes 35-95
* 0x3A - 0x3E: Access codes 35-39
* 0x3F - 0x73: Access codes 43-95
*/
if (panelData[panelByte] >= 0x3A && panelData[panelByte] <= 0x73) {
byte dscCode = panelData[panelByte] - 0x17;
stream->print(F("Disarmed: "));
printPanelAccessCode(dscCode, false);
return;
}
stream->print("Unknown data");
}
/*
* Status messages set 0x14 for panel commands: 0xEB, 0xEC
* Structure decoding: complete
* Content decoding: likely incomplete - observed messages from logs have been decoded, but there are gaps in
* the numerical list of messages.
*
* These commands use 1 byte for the status message, and appear to use the preceding byte to select
* from multiple sets of status messages, split into printPanelStatus4...printPanelStatus1B.
*/
void dscKeybusInterface::printPanelStatus14(byte panelByte) {
#if !defined(__AVR__) // Excludes Arduino/AVR to conserve storage space
switch (panelData[panelByte]) {
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;
}
#endif
printUnknownData();
}